-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[AutoDiff] Handle @inout_aliasable
when converting associated functions
#26484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ions. When reapplying a `partial_apply` for a JVP/VJP, if the argument has convention `@inout_aliasable`, it is a noescape mutable capture and the underlying value should not be retained. This fixes a memory leak when a noescape closure being differentiated captures a mutable self.
@swift-ci please test tensorflow |
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.
Nice! I wonder if there are other argument conventions that require special handling?
dc73d38
to
0284b03
Compare
@swift-ci please test tensorflow |
1 similar comment
@swift-ci please test tensorflow |
It appears that this is the only special case. I asked a question on the forum. |
0284b03
to
19e86c4
Compare
@swift-ci please test tensorflow |
When reapplying a
partial_apply
for a JVP/VJP, if the argument has convention@inout_aliasable
, it is a noescape mutable capture and the underlying value should not be retained. This fixes a memory leak when a noescape closure being differentiated captures a mutable self.Resolves eaplatanios/swift-ale#1.