Skip to content

Commit b263ac4

Browse files
committed
deal with zerotangents
1 parent 5bff5bc commit b263ac4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/common/defaults.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ defaulttol(x::Any) = eps(real(float(one(eltype(x)))))^(2 / 3)
1515
Default tolerance for deciding to warn if incoming adjoints of a pullback rule
1616
has components that are not gauge-invariant.
1717
"""
18-
default_pullback_gauge_atol(A) = eps(norm(A, Inf))^(3 / 4)
18+
default_pullback_gauge_atol(A) = iszerotangent(A) ? 0 : eps(norm(A, Inf))^(3 / 4)
1919
default_pullback_gauge_atol(A, As...) = maximum(default_pullback_gauge_atol, (A, As...))
2020

2121
"""

0 commit comments

Comments
 (0)