Skip to content

Commit

Permalink
Merge pull request #283 from JuliaDiff/ox/for_cedar/zint
Browse files Browse the repository at this point in the history
For Cedar port of handling intrinstics called with zero tangents
  • Loading branch information
oxinabox committed Mar 18, 2024
2 parents 9e6af67 + a4ec452 commit 99cf1a3
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 @@ -338,6 +338,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 99cf1a3

Please sign in to comment.