Skip to content

[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

Merged
merged 2 commits into from
Aug 6, 2019

Conversation

rxwei
Copy link
Contributor

@rxwei rxwei commented Aug 4, 2019

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.

…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.
@rxwei rxwei added the tensorflow This is for "tensorflow" branch PRs. label Aug 4, 2019
@rxwei rxwei requested a review from dan-zheng August 4, 2019 21:56
@rxwei
Copy link
Contributor Author

rxwei commented Aug 4, 2019

@swift-ci please test tensorflow

Copy link
Contributor

@dan-zheng dan-zheng left a 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?

@rxwei rxwei force-pushed the ad-inout-aliasable-capture branch from dc73d38 to 0284b03 Compare August 4, 2019 22:15
@rxwei
Copy link
Contributor Author

rxwei commented Aug 4, 2019

@swift-ci please test tensorflow

1 similar comment
@rxwei
Copy link
Contributor Author

rxwei commented Aug 4, 2019

@swift-ci please test tensorflow

@rxwei
Copy link
Contributor Author

rxwei commented Aug 5, 2019

Nice! I wonder if there are other argument conventions that require special handling?

It appears that this is the only special case. I asked a question on the forum.

@rxwei rxwei force-pushed the ad-inout-aliasable-capture branch from 0284b03 to 19e86c4 Compare August 6, 2019 18:39
@rxwei
Copy link
Contributor Author

rxwei commented Aug 6, 2019

@swift-ci please test tensorflow

2 similar comments
@rxwei
Copy link
Contributor Author

rxwei commented Aug 6, 2019

@swift-ci please test tensorflow

@rxwei
Copy link
Contributor Author

rxwei commented Aug 6, 2019

@swift-ci please test tensorflow

@rxwei rxwei merged commit 6773a69 into swiftlang:tensorflow Aug 6, 2019
@rxwei rxwei deleted the ad-inout-aliasable-capture branch August 6, 2019 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tensorflow This is for "tensorflow" branch PRs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants