Skip to content

Commit 6778384

Browse files
Update src/GNNGraphs/utils.jl
Co-authored-by: Carlo Lucibello <[email protected]>
1 parent 0fb4139 commit 6778384

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/GNNGraphs/utils.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,8 @@ function cat_features(xs::Vector{<:NamedTuple})
3434

3535
# concatenate
3636
syms = symbols[1]
37-
dims = [max(1, ndims(xs[1][k])) for k in syms] # promote scalar to 1D
38-
methods = [dim == 1 ? vcat : hcat for dim in dims] # use optimized reduce(hcat,xs) or reduce(vcat,xs)
3937
NamedTuple(
40-
k => reduce(methods[ii],[x[k] for x in xs]) for (ii,k) in enumerate(syms)
38+
k => cat_features([x[k] for x in xs]) for (ii,k) in enumerate(syms)
4139
)
4240
end
4341

0 commit comments

Comments
 (0)