File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ function check_num_nodes(g::GNNGraph, x::AbstractArray)
2
2
@assert g. num_nodes == size (x, ndims (x)) " Got $(size (x, ndims (x))) as last dimension size instead of num_edges=$(g. num_nodes) "
3
3
return true
4
4
end
5
- function check_num_nodes (g:: GNNGraph , x:: NamedTuple )
5
+ function check_num_nodes (g:: GNNGraph , x:: Union{Tuple, NamedTuple} )
6
6
map (x -> check_num_nodes (g, x), x)
7
7
return true
8
8
end
@@ -13,7 +13,7 @@ function check_num_edges(g::GNNGraph, e::AbstractArray)
13
13
@assert g. num_edges == size (e, ndims (e)) " Got $(size (e, ndims (e))) as last dimension size instead of num_edges=$(g. num_edges) "
14
14
return true
15
15
end
16
- function check_num_edges (g:: GNNGraph , x:: NamedTuple )
16
+ function check_num_edges (g:: GNNGraph , x:: Union{Tuple, NamedTuple} )
17
17
map (x -> check_num_edges (g, x), x)
18
18
return true
19
19
end
Original file line number Diff line number Diff line change 136
136
@test spmm_fused (g) ≈ X * A
137
137
@test spmm_fused2 (g) ≈ X * A
138
138
end
139
+
140
+ @testset " aggregate_neighbors" begin
141
+ m = rand (2 , g. num_edges- 1 )
142
+ @test_throws AssertionError aggregate_neighbors (g, + , m)
143
+
144
+ m = (a= rand (2 , g. num_edges+ 1 ), b= nothing )
145
+ @test_throws AssertionError aggregate_neighbors (g, + , m)
146
+ end
139
147
end
You can’t perform that action at this time.
0 commit comments