We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2c0ed36 commit 378aea2Copy full SHA for 378aea2
src/rulesets/LinearAlgebra/structured.jl
@@ -290,7 +290,7 @@ function rrule(::typeof(logdet), x::SparseMatrixCSC)
290
Ω = logdet(x)
291
function logdet_pullback(ΔΩ)
292
Z, p = sparseinv(x, depermute=true)
293
- ∂x = x isa Number ? ΔΩ / x' : ΔΩ * Z'
+ ∂x = ΔΩ * Z'
294
return (NoTangent(), ∂x)
295
end
296
return Ω, logdet_pullback
@@ -300,7 +300,7 @@ function rrule(::typeof(det), x::SparseMatrixCSC)
300
Ω = det(x)
301
function det_pullback(ΔΩ)
302
Z, _ = sparseinv(x, depermute=true)
303
- ∂x = x isa Number ? ΔΩ : Z' * dot(Ω, ΔΩ)
+ ∂x = Z' * dot(Ω, ΔΩ)
304
305
306
return Ω, det_pullback
0 commit comments