Skip to content

Commit 6e532af

Browse files
committed
Just call primal on intrinics if all tangents are zero
1 parent 2accab5 commit 6e532af

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/stage1/forward.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,12 @@ function (this::∂☆{N})(::AbstractZeroBundle{N, typeof(typeof)}, x::ATB{N}) w
285285
DNEBundle{N}(typeof(primal(x)))
286286
end
287287

288+
289+
function (this::∂☆{N})(f::AbstractZeroBundle{N, Core.IntrinsicFunction}, args::AbstractZeroBundle{N}...) where {N}
290+
ff=primal(f)
291+
return (zero_bundle{N}())(ff(map(primal, args)...))
292+
end
293+
288294
function (this::∂☆{N})(f::AbstractZeroBundle{N, Core.IntrinsicFunction}, args::ATB{N}...) where {N}
289295
ff = primal(f)
290296
if ff in (Base.not_int, Base.ne_float)

0 commit comments

Comments
 (0)