Skip to content

Commit 87674d8

Browse files
cleanup
1 parent 965314c commit 87674d8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/GNNGraphs/query.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ function Graphs.degree(g::GNNGraph{<:ADJMAT_T}, T=nothing; dir=:out, edge_weight
182182
vec(sum(A, dims=1)) .+ vec(sum(A, dims=2))
183183
end
184184

185-
function Graphs.laplacian_matrix(g::GNNGraph, T=nothing; dir::Symbol=:out)
185+
function Graphs.laplacian_matrix(g::GNNGraph, T::DataType=Float32; dir::Symbol=:out)
186186
A = adjacency_matrix(g, T; dir=dir)
187187
D = Diagonal(vec(sum(A; dims=2)))
188188
return D - A
@@ -201,13 +201,13 @@ Normalized Laplacian matrix of graph `g`.
201201
- `add_self_loops`: add self-loops while calculating the matrix.
202202
- `dir`: the edge directionality considered (:out, :in, :both).
203203
"""
204-
function normalized_laplacian(g::GNNGraph, T=nodetype(g);
204+
function normalized_laplacian(g::GNNGraph, T::DataType=Float32;
205205
add_self_loops::Bool=false, dir::Symbol=:out)
206206
= normalized_adjacency(g, T; dir, add_self_loops)
207207
return I -
208208
end
209209

210-
function normalized_adjacency(g::GNNGraph, T=nodetype(g);
210+
function normalized_adjacency(g::GNNGraph, T::DataType=Float32;
211211
add_self_loops::Bool=false, dir::Symbol=:out)
212212
A = adjacency_matrix(g, T; dir=dir)
213213
if add_self_loops
@@ -230,7 +230,7 @@ defined as ``\hat{L} = \frac{2}{\lambda_{max}} L - I`` where ``L`` is the normal
230230
- `T`: result element type.
231231
- `dir`: the edge directionality considered (:out, :in, :both).
232232
"""
233-
function scaled_laplacian(g::GNNGraph, T=nothing; dir=:out)
233+
function scaled_laplacian(g::GNNGraph, T::DataType=Float32; dir=:out)
234234
L = normalized_laplacian(g, T)
235235
@assert issymmetric(L) "scaled_laplacian only works with symmetric matrices"
236236
λmax = _eigmax(L)

0 commit comments

Comments
 (0)