Skip to content

Commit 378aea2

Browse files
committed
remove unneccesary Number checks
1 parent 2c0ed36 commit 378aea2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/rulesets/LinearAlgebra/structured.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ function rrule(::typeof(logdet), x::SparseMatrixCSC)
290290
Ω = logdet(x)
291291
function logdet_pullback(ΔΩ)
292292
Z, p = sparseinv(x, depermute=true)
293-
∂x = x isa Number ? ΔΩ / x' : ΔΩ * Z'
293+
∂x = ΔΩ * Z'
294294
return (NoTangent(), ∂x)
295295
end
296296
return Ω, logdet_pullback
@@ -300,7 +300,7 @@ function rrule(::typeof(det), x::SparseMatrixCSC)
300300
Ω = det(x)
301301
function det_pullback(ΔΩ)
302302
Z, _ = sparseinv(x, depermute=true)
303-
∂x = x isa Number ? ΔΩ : Z' * dot(Ω, ΔΩ)
303+
∂x = Z' * dot(Ω, ΔΩ)
304304
return (NoTangent(), ∂x)
305305
end
306306
return Ω, det_pullback

0 commit comments

Comments
 (0)