-
-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
wrap_chainrules_input for arrays of Ref #1103
Conversation
@@ -115,6 +115,7 @@ for T_outer in (:Tuple, :NamedTuple) | |||
ChainRulesCore.backing(xp) # this is accessing ChainRulesCore internals, but it is prob safe enough, and it is fastest | |||
end | |||
end | |||
@inline wrap_chainrules_output(xs::AbstractArray{<:ChainRules.Tangent}) = wrap_chainrules_output.(xs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could surely be made into reinterpret
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But mostly I'd like to make things work correctly, before thinking about making them faster.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added some comments.
This wants to make
wrap_chainrules_input
and friends understand arrays of mutable structs. Continuation of #1102, aims to solve JuliaDiff/ChainRules.jl#539 (comment) and assorted other problems related to ChainRules types.WIP, since thesum(f, xs)
case doesn't work yet.