Skip to content

Commit

Permalink
Switch to pullbacks only taking a single input
Browse files Browse the repository at this point in the history
  • Loading branch information
oxinabox committed May 7, 2020
1 parent 2d8b265 commit 23ef736
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions src/rulesets/Base/base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,3 @@ function rrule(::typeof(identity), x)
end
return (x, identity_pullback)
end

function rrule(::typeof(identity), x::Tuple)
# `identity(::Tuple)` returns multiple outputs;because that is how we think of
# returning a tuple, so its pullback needs to accept multiple inputs.
# `identity(::Tuple)` has one input, so its pullback should return 1 matching output
# see https://github.com/JuliaDiff/ChainRulesCore.jl/issues/152
function identity_pullback(ȳs...)
return (NO_FIELDS, Composite{typeof(x)}(ȳs...))
end
return x, identity_pullback
end

0 comments on commit 23ef736

Please sign in to comment.