Skip to content

Commit 4b5f303

Browse files
fix
1 parent 2bdcaff commit 4b5f303

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

GNNGraphs/test/Project.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[deps]
2+
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
23
FiniteDifferences = "26cc04aa-876d-5657-8c51-4c34ba976000"
34
Functors = "d9f16b24-f501-4c13-a1f2-28368ffc5196"
45
GNNGraphs = "aed8fd31-079b-4b5a-b342-a13352159b8c"
@@ -13,11 +14,13 @@ Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
1314
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
1415
SimpleWeightedGraphs = "47aef6b3-ad0c-573a-a1e2-d07658019622"
1516
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
17+
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
1618
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
1719
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1820
TestItemRunner = "f8b46487-2199-4994-9208-9a1283c18c0a"
1921
TestItems = "1c621080-faea-4a02-84b6-bbd5e436b8fe"
2022
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
23+
cuDNN = "02a925ec-e4fe-4b08-9a7e-0d78e3d38ccd"
2124

2225
[compat]
2326
GPUArraysCore = "0.1"

GNNGraphs/test/gnngraph.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ end
9494
@test adjacency_matrix(g; dir = :in) == adj_mat
9595
@test adjacency_matrix(g; dir = :out) == adj_mat
9696

97-
if TEST_GPU && !(dev isa MetalDevice)
97+
if TEST_GPU && !(dev isa MetalDevice) && GRAPH_T != :sparse
9898
# See https://github.com/JuliaGPU/CUDA.jl/pull/1093
9999
mat_gpu = adjacency_matrix(g_gpu)
100100
@test mat_gpu isa AbstractMatrix{Int}
@@ -105,7 +105,7 @@ end
105105

106106
@testset "normalized_laplacian" begin
107107
mat = normalized_laplacian(g)
108-
if TEST_GPU && !(dev isa MetalDevice)
108+
if TEST_GPU && !(dev isa MetalDevice) && GRAPH_T != :sparse
109109
mat_gpu = normalized_laplacian(g_gpu)
110110
@test mat_gpu isa AbstractMatrix{Float32}
111111
@test get_device(mat_gpu)isa AbstractGPUDevice
@@ -114,7 +114,7 @@ end
114114
end
115115

116116
@testset "scaled_laplacian" begin
117-
if TEST_GPU && !(dev isa MetalDevice)
117+
if TEST_GPU && !(dev isa MetalDevice) && GRAPH_T != :sparse
118118
mat = scaled_laplacian(g)
119119
mat_gpu = scaled_laplacian(g_gpu)
120120
@test mat_gpu isa AbstractMatrix{Float32}
@@ -132,10 +132,10 @@ end
132132
@testset "functor" begin
133133
s_cpu, t_cpu = edge_index(g)
134134
s_gpu, t_gpu = edge_index(g_gpu)
135-
@test s_gpu isa AbstractVector{Int}
135+
@test s_gpu isa AbstractVector{<:Integer}
136136
@test get_device(s_gpu) isa AbstractGPUDevice
137137
@test Array(s_gpu) == s_cpu
138-
@test t_gpu isa AbstractVector{Int}
138+
@test t_gpu isa AbstractVector{<:Integer}
139139
@test get_device(t_gpu) isa AbstractGPUDevice
140140
@test Array(t_gpu) == t_cpu
141141
end

GNNGraphs/test/sampling.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ end
108108
@test !isempty(mini_batch_gnn.graph)
109109

110110
num_sampled_nodes = mini_batch_gnn.num_nodes
111-
println("Number of nodes in mini-batch: ", num_sampled_nodes)
112111

113112
@test num_sampled_nodes == 2
114113

GNNGraphs/test/utils.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,16 +94,16 @@
9494
end
9595

9696
@testitem "color_refinement" setup=[GraphsTestModule] begin
97-
# TODO: this passes only on julia 1.10. Use a deterministic graph generator
9897
using .GraphsTestModule
98+
using StableRNGs
9999
for GRAPH_T in GRAPH_TYPES
100-
rng = MersenneTwister(17)
100+
rng = StableRNG(17)
101101
g = rand_graph(rng, 10, 20, graph_type = GRAPH_T)
102102
x0 = ones(Int, 10)
103103
x, ncolors, niters = color_refinement(g, x0)
104-
@test ncolors == 7
104+
@test ncolors == 9
105105
@test niters == 2
106-
@test x == [1, 1, 6, 6, 6, 7, 8, 9, 10, 11]
106+
@test x == [6, 7, 8, 9, 10, 11, 12, 6, 13, 14]
107107

108108
x2, _, _ = color_refinement(g)
109109
@test x2 == x

0 commit comments

Comments
 (0)