Skip to content

Commit c48b6c0

Browse files
kshyattlkdvos
andcommitted
Update ext/TensorKitChainRulesCoreExt/linalg.jl
Co-authored-by: Lukas Devos <ldevos98@gmail.com>
1 parent 00860d5 commit c48b6c0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎ext/TensorKitChainRulesCoreExt/linalg.jl‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ function ChainRulesCore.rrule(::typeof(normalize), a::AbstractTensorMap, p::Real
126126
y = scale(a, inv(n))
127127
function normalize_pullback(Δy_)
128128
Δy = unthunk(Δy_)
129-
Δa = add(Δy, y, -real(dot(y, Δy))) / n
129+
Δa = add(Δy, y, -real(dot(y, Δy)) / n, inv(n))
130130
return NoTangent(), ProjectTo(a)(Δa), NoTangent()
131131
end
132132
normalize_pullback(::AbstractZero) = NoTangent(), ZeroTangent(), NoTangent()

0 commit comments

Comments
 (0)