Skip to content

Commit 34abbcb

Browse files
committed
Replace findlast with count
1 parent a4eb3f3 commit 34abbcb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/TensorKitChainRulesCoreExt/factorizations.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ end
376376
function qr_pullback!(ΔA::AbstractMatrix, Q::AbstractMatrix, R::AbstractMatrix, ΔQ, ΔR;
377377
tol::Real=default_pullback_gaugetol(R))
378378
Rd = view(R, diagind(R))
379-
p = findlast(>=(tol) abs, Rd)
379+
p = count(>=(tol) abs, Rd)
380380
m, n = size(R)
381381

382382
Q1 = view(Q, :, 1:p)
@@ -427,7 +427,7 @@ end
427427
function lq_pullback!(ΔA::AbstractMatrix, L::AbstractMatrix, Q::AbstractMatrix, ΔL, ΔQ;
428428
tol::Real=default_pullback_gaugetol(L))
429429
Ld = view(L, diagind(L))
430-
p = findlast(>=(tol) abs, Ld)
430+
p = count(>=(tol) abs, Ld)
431431
m, n = size(L)
432432

433433
L1 = view(L, :, 1:p)

0 commit comments

Comments
 (0)