Skip to content

Commit a224388

Browse files
authored
Add fwd rule for Core.ifelse (#141)
Same as Base.ifelse, but it's a separate generic function, so needs its own rule.
1 parent 5af916f commit a224388

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/stage1/forward.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,10 @@ function (::∂☆{N})(f::ZeroBundle{N, typeof(ifelse)}, arg::ATB{N, Bool}, args
215215
ifelse(arg.primal, args...)
216216
end
217217

218+
function (::∂☆{N})(f::ZeroBundle{N, typeof(Core.ifelse)}, arg::ATB{N, Bool}, args::ATB{N}...) where {N}
219+
Core.ifelse(arg.primal, args...)
220+
end
221+
218222
struct FwdIterate{N, T<:AbstractTangentBundle{N}}
219223
f::T
220224
end

0 commit comments

Comments
 (0)