Skip to content

Commit e0282b0

Browse files
committed
Fix bug
1 parent 1375e6a commit e0282b0

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

src/utils.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ topk_index(y::Adjoint, k::Integer) = topk_index(y', k)
1212
## Get feature with defaults
1313

1414
get_feature(::Nothing, i) = nothing
15-
get_feature(::Fill{T,2,Axes}, i::Integer) where {T,Axes} = nothing
15+
get_feature(A::Fill{T,2,Axes}, i::Integer) where {T,Axes} = view(A, :, 1)
1616
get_feature(A::AbstractMatrix, i::Integer) = view(A, :, i)
1717

1818
"""

test/layers/msgpass.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ in_channel = 10
22
out_channel = 5
33
num_V = 6
44
num_E = 7
5+
T = Float32
56
adj = [0. 1. 0. 0. 0. 0.;
67
1. 0. 0. 1. 1. 1.;
78
0. 0. 0. 0. 0. 1.;
@@ -16,8 +17,9 @@ NewLayer(m, n) = NewLayer(randn(m,n))
1617

1718
(l::NewLayer)(fg) = propagate(l, fg, :add)
1819

19-
X = Array(reshape(1:num_V*in_channel, in_channel, num_V))
20+
X = Array{T}(reshape(1:num_V*in_channel, in_channel, num_V))
2021
fg = FeaturedGraph(adj, X)
22+
fg.ef = Fill(zero(T), 0, 2num_E)
2123

2224
l = NewLayer(out_channel, in_channel)
2325

test/runtests.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ using GeometricFlux
22
using GeometricFlux.Datasets
33
using Flux
44
using Flux: @functor
5+
using FillArrays
56
using GraphSignals
67
using StaticArrays: @MMatrix, @MArray
78
using LightGraphs: SimpleGraph, SimpleDiGraph, add_edge!, nv, ne

0 commit comments

Comments
 (0)