|
74 | 74 | # when we also have edge_weight we need to convert the graph to COO
|
75 | 75 | function gcn_conv(l, g::GNNGraph{<:ADJMAT_T}, x, edge_weight::EW, norm_fn::F, conv_weight::CW) where
|
76 | 76 | {EW <: Union{Nothing, AbstractVector}, CW<:Union{Nothing,AbstractMatrix}, F}
|
77 |
| - g = GNNGraph(edge_index(g)...; g.num_nodes) # convert to COO |
| 77 | + g = GNNGraph(g, graph_type = :coo) |
78 | 78 | return gcn_conv(l, g, x, edge_weight, norm_fn, conv_weight)
|
79 | 79 | end
|
80 | 80 |
|
@@ -449,9 +449,10 @@ function sgc_conv(l, g::GNNGraph, x::AbstractMatrix{T},
|
449 | 449 | return (x .+ l.bias)
|
450 | 450 | end
|
451 | 451 |
|
| 452 | +# when we also have edge_weight we need to convert the graph to COO |
452 | 453 | function sgc_conv(l, g::GNNGraph{<:ADJMAT_T}, x::AbstractMatrix,
|
453 | 454 | edge_weight::AbstractVector)
|
454 |
| - g = GNNGraph(edge_index(g)...; g.num_nodes) |
| 455 | + g = GNNGraph(g; graph_type=:coo) |
455 | 456 | return sgc_conv(l, g, x, edge_weight)
|
456 | 457 | end
|
457 | 458 |
|
@@ -542,9 +543,10 @@ function sg_conv(l, g::GNNGraph, x::AbstractMatrix{T},
|
542 | 543 | return (x .+ l.bias)
|
543 | 544 | end
|
544 | 545 |
|
| 546 | +# when we also have edge_weight we need to convert the graph to COO |
545 | 547 | function sg_conv(l, g::GNNGraph{<:ADJMAT_T}, x::AbstractMatrix,
|
546 | 548 | edge_weight::AbstractVector)
|
547 |
| - g = GNNGraph(edge_index(g)...; g.num_nodes) |
| 549 | + g = GNNGraph(g; graph_type=:coo) |
548 | 550 | return sg_conv(l, g, x, edge_weight)
|
549 | 551 | end
|
550 | 552 |
|
@@ -684,9 +686,10 @@ function tag_conv(l, g::GNNGraph, x::AbstractMatrix{T},
|
684 | 686 | return (sum_total .+ l.bias)
|
685 | 687 | end
|
686 | 688 |
|
| 689 | +# when we also have edge_weight we need to convert the graph to COO |
687 | 690 | function tag_conv(l, g::GNNGraph{<:ADJMAT_T}, x::AbstractMatrix,
|
688 | 691 | edge_weight::AbstractVector)
|
689 |
| - g = GNNGraph(edge_index(g)...; g.num_nodes) |
| 692 | + g = GNNGraph(g; graph_type = :coo) |
690 | 693 | return l(g, x, edge_weight)
|
691 | 694 | end
|
692 | 695 |
|
|
0 commit comments