Skip to content

Commit

Permalink
use GBMatrix
Browse files Browse the repository at this point in the history
  • Loading branch information
CarloLucibello committed Nov 16, 2021
1 parent 5d53d05 commit 6cd2f0a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
SuiteSparseGraphBLAS = "c2e53296-7b14-11e9-1210-bddfa8111e1d"
TestEnv = "1e6cf692-eddd-4d53-88a5-2d735e33781b"

[compat]
Expand Down
4 changes: 2 additions & 2 deletions src/GNNGraphs/convert.jl
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ function to_sparse(A::ADJMAT_T, T::DataType=eltype(A); dir=:out, num_nodes=nothi
A = T.(A)
end
if !(A isa AbstractSparseMatrix)
A = sparse(A)
A = GBMatrix(sparse(A))
end
return A, num_nodes, num_edges
end
Expand All @@ -140,7 +140,7 @@ function to_sparse(coo::COO_T, T::DataType=Int; dir=:out, num_nodes=nothing)
num_nodes = isnothing(num_nodes) ? max(maximum(s), maximum(t)) : num_nodes
A = sparse(s, t, eweight, num_nodes, num_nodes)
num_edges = length(s)
return A, num_nodes, num_edges
return GBMatrix(A), num_nodes, num_edges
end


Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ tests = [

!CUDA.functional() && @warn("CUDA unavailable, not testing GPU support")

@testset "GraphNeuralNetworks: graph format $graph_type" for graph_type in (:coo, :dense, :sparse)
@testset "GraphNeuralNetworks: graph format $graph_type" for graph_type in (:sparse, :coo, :dense,)
global GRAPH_T = graph_type
global TEST_GPU = CUDA.functional() && (GRAPH_T != :sparse)

Expand Down

0 comments on commit 6cd2f0a

Please sign in to comment.