Skip to content

Commit 75633db

Browse files
committed
Fix rank in svd pullback
1 parent 3abe711 commit 75633db

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/TensorKitChainRulesCoreExt/factorizations.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ function svd_pullback!(ΔA::AbstractMatrix, U::AbstractMatrix, S::AbstractVector
219219
Sp = view(S, 1:p)
220220

221221
# rank
222-
r = findlast(>=(tol), S)
222+
r = count(>(tol), S)
223223

224224
# compute antihermitian part of projection of ΔU and ΔV onto U and V
225225
# also already subtract this projection from ΔU and ΔV

0 commit comments

Comments
 (0)