Skip to content
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

Merged
merged 7 commits into from
Oct 16, 2021
Merged

Conversation

mcabbott
Copy link
Member

@mcabbott mcabbott commented Oct 15, 2021

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 the sum(f, xs) case doesn't work yet.

@@ -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)
Copy link
Member Author

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.

Copy link
Member Author

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added some comments.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants