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

**URL:** <https://discourse.julialang.org/t/objects-of-type-sparsearrays-sparsematrixcsc-float64-int64-are-not-callable/87791>\
**Category:** General Usage\
**Created:** [September 25, 2022, 11:02pm UTC](https://discourse.julialang.org/t/objects-of-type-sparsearrays-sparsematrixcsc-float64-int64-are-not-callable/87791 "2022-09-25T23:02:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![m\_shah2](https://avatars.discourse-cdn.com/v4/letter/m/65b543/32.png) [@m\_shah2](https://discourse.julialang.org/u/m_shah2)\
**Post date:** [September 25, 2022, 11:02pm UTC](https://discourse.julialang.org/t/objects-of-type-sparsearrays-sparsematrixcsc-float64-int64-are-not-callable/87791/1 "2022-09-25T23:02:30Z")

</div>

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.

Stacktrace:  
[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:

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [September 25, 2022, 11:39pm UTC](https://discourse.julialang.org/t/objects-of-type-sparsearrays-sparsematrixcsc-float64-int64-are-not-callable/87791/2 "2022-09-25T23:39:01Z")

</div>

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.
