Objects of type SparseArrays.SparseMatrixCSC{Float64, Int64} are not callable

When I try to run
T_motif = spectral_embedding(W, 3);
T_edge = spectral_embedding(max.(A, A’), 3);

I get an error:

MethodError: objects of type SparseArrays.SparseMatrixCSC{Float64, Int64} are not callable
Use square brackets for indexing an Array.

[1] mapreduce_first(f::SparseArrays.SparseMatrixCSC{Float64, Int64}, op::Function, x::Int64)
@ Base .\reduce.jl:411
[2] mapreduce(f::SparseArrays.SparseMatrixCSC{Float64, Int64}, op::Function, a::Int64)
@ Base .\reduce.jl:438
[3] sum(f::SparseArrays.SparseMatrixCSC{Float64, Int64}, a::Int64; kw::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ Base .\reduce.jl:520
[4] sum(f::SparseArrays.SparseMatrixCSC{Float64, Int64}, a::Int64)
@ Base .\reduce.jl:520
[5] spectral_embedding(W::SparseArrays.SparseMatrixCSC{Float64, Int64}, nev::Int64)
@ Main .\In[15]:3
[6] top-level scope
@ In[27]:1
[7] eval
@ .\boot.jl:368 [inlined]
[8] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
@ Base .\loading.jl:1428

Here, W is a 456×456 SparseArrays.SparseMatrixCSC{Float64, Int64} with 207626 stored entries:

From the error message, spectral_embedding(W, 3) is calling sum(W, 3), which doesn’t make sense when W is a matrix (rather than a function). So you have a bug in your code.