Open Roger-luo opened 5 years ago
Just copy from slack
This is mainly because SparseMatrixCSC
is not using the broadcast for +/-
:
(+)(A::SparseMatrixCSC, B::SparseMatrixCSC) = map(+, A, B)
(-)(A::SparseMatrixCSC, B::SparseMatrixCSC) = map(-, A, B)
Should check if this can be turn into broadcast
in upstream, according to @mbauman
It likely predated an efficient broadcast implementation
Can be workaround by adding adjoints for +/-
tho.
Sorry — I steered you wrong here. map
itself is indeed implemented using the same infrastructure broadcast uses, so changing it to broadcast doesn't really help (as you can see by changing -
to .-
in your MWE).
OK, I see... But I thought this should just work without any other adjoints. Probably something else then.
Seems this miss an adjoint
MWE: