diff --git a/src/pullbacks/svd.jl b/src/pullbacks/svd.jl index 6c42bc26d..090012553 100755 --- a/src/pullbacks/svd.jl +++ b/src/pullbacks/svd.jl @@ -37,7 +37,7 @@ function check_and_prepare_svd_cotangents( mul!(utmp, U₁, wtmp, -1, 1) ΔgaugeU = max(ΔgaugeU, norm(utmp)) else # remaining columns should be zero - ΔgaugeU = max(ΔgaugeU, norm(view(ΔU, :, j), Inf)) + ΔgaugeU = max(ΔgaugeU, maximum(abs, view(ΔU, :, j); init = abs(zero(eltype(ΔU))))) end end end @@ -69,7 +69,7 @@ function check_and_prepare_svd_cotangents( mul!(vtmp, wtmp, V₁ᴴ, -1, 1) ΔgaugeV = max(ΔgaugeV, norm(vtmp)) else # remaining rows should be zero - ΔgaugeV = max(ΔgaugeV, norm(view(ΔVᴴ, j, :), Inf)) + ΔgaugeV = max(ΔgaugeV, maximum(abs, view(ΔVᴴ, j, :); init = abs(zero(eltype(ΔVᴴ))))) end end end