Skip to content

Commit

Permalink
Avoid closure problem
Browse files Browse the repository at this point in the history
  • Loading branch information
leburgel committed Jun 3, 2024
1 parent 7b8758d commit f2388a8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ext/TensorKitChainRulesCoreExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ function qr_pullback!(ΔA::AbstractMatrix, Q::AbstractMatrix, R::AbstractMatrix,
rtol::Real=atol > 0 ? 0 : eps(real(eltype(R)))^(3 / 4))
Rd = view(R, diagind(R))
tol = atol > 0 ? atol : rtol * maximum(abs, Rd)
p = findlast(x -> abs(x) >= tol, Rd)
p = findlast(>=(tol) abs, Rd)
m, n = size(R)

Q1 = view(Q, :, 1:p)
Expand Down Expand Up @@ -590,7 +590,7 @@ function lq_pullback!(ΔA::AbstractMatrix, L::AbstractMatrix, Q::AbstractMatrix,
rtol::Real=atol > 0 ? 0 : eps(real(eltype(L)))^(3 / 4))
Ld = view(L, diagind(L))
tol = atol > 0 ? atol : rtol * maximum(abs, Ld)
p = findlast(x -> abs(x) >= tol, Ld)
p = findlast(>=(tol) abs, Rd)
m, n = size(L)

L1 = view(L, :, 1:p)
Expand Down

0 comments on commit f2388a8

Please sign in to comment.