Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion GNNGraphs/src/convert.jl
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function to_dense(A::ADJMAT_T, T = nothing; dir = :out, num_nodes = nothing,
A = T.(A)
end
if !weighted
A = map(x -> ifelse(x > 0, T(1), T(0)), A)
A = binarize(A, T)
end
return A, num_nodes, num_edges
end
Expand Down
9 changes: 9 additions & 0 deletions GNNGraphs/test/query.jl
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,15 @@ end

@test gw == [1, 1, 1]
end

@testset "fmt" begin
Asparse = adjacency_matrix(g, weighted = false, fmt = :sparse)
@test Asparse isa AbstractSparseMatrix
Adense = adjacency_matrix(g, weighted = false, fmt = :dense)
@test Adense isa AbstractMatrix
@test !(Adense isa AbstractSparseMatrix)
@test collect(Asparse) == Adense
end
end

@testset "khop_adj" begin
Expand Down
2 changes: 1 addition & 1 deletion GNNlib/ext/GNNlibCUDAExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module GNNlibCUDAExt
using CUDA
using Random, Statistics, LinearAlgebra
using GNNlib: GNNlib, propagate, copy_xj, e_mul_xj, w_mul_xj
using GNNGraphs: GNNGraph, COO_T, SPARSE_T, to_dense, to_sparse
using GNNGraphs: GNNGraph, COO_T, SPARSE_T, to_dense, to_sparse, adjacency_matrix
using ChainRulesCore: @non_differentiable

const CUDA_COO_T = Tuple{T, T, V} where {T <: AnyCuArray{<:Integer}, V <: Union{Nothing, AnyCuArray}}
Expand Down
Loading