Skip to content

Commit 0f74c78

Browse files
authored
Merge pull request #282 from JuliaDiff/ox/zint
Just call primal on intrinics if all tangents are zero
2 parents 2accab5 + 6e532af commit 0f74c78

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)