Skip to content

Commit 6b16b48

Browse files
committed
attempt to contain type instability
1 parent b263ac4 commit 6b16b48

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/common/defaults.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ Default tolerance for deciding to warn if incoming adjoints of a pullback rule
1616
has components that are not gauge-invariant.
1717
"""
1818
default_pullback_gauge_atol(A) = iszerotangent(A) ? 0 : eps(norm(A, Inf))^(3 / 4)
19-
default_pullback_gauge_atol(A, As...) = maximum(default_pullback_gauge_atol, (A, As...))
19+
function default_pullback_gauge_atol(A, As...)
20+
As′ = filter(!iszerotangent, (A, As...))
21+
return isempty(As′) ? 0 : eps(norm(As′, Inf))^(3 / 4)
22+
end
2023

2124
"""
2225
default_pullback_degeneracy_atol(A)

0 commit comments

Comments
 (0)