Skip to content

Commit

Permalink
Merge pull request #282 from JuliaDiff/ox/zint
Browse files Browse the repository at this point in the history
Just call primal on intrinics if all tangents are zero
  • Loading branch information
oxinabox authored Mar 18, 2024
2 parents 2accab5 + 6e532af commit 0f74c78
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/stage1/forward.jl
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,12 @@ function (this::∂☆{N})(::AbstractZeroBundle{N, typeof(typeof)}, x::ATB{N}) w
DNEBundle{N}(typeof(primal(x)))
end


function (this::∂☆{N})(f::AbstractZeroBundle{N, Core.IntrinsicFunction}, args::AbstractZeroBundle{N}...) where {N}
ff=primal(f)
return (zero_bundle{N}())(ff(map(primal, args)...))
end

function (this::∂☆{N})(f::AbstractZeroBundle{N, Core.IntrinsicFunction}, args::ATB{N}...) where {N}
ff = primal(f)
if ff in (Base.not_int, Base.ne_float)
Expand Down

0 comments on commit 0f74c78

Please sign in to comment.