Skip to content

[AutoDiff] Not differentiate through global closures flow-sensitively. #25676

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 1 commit into from
Jun 22, 2019

Conversation

rxwei
Copy link
Contributor

@rxwei rxwei commented Jun 22, 2019

Earlier we added a hack to differentiate global constants or variables that are initialized with a closure whose body is differentiable. However, function conversion should not be flow-sensitive. This patch removes the hack.

Earlier we added a hack to differentiate global constants or
variables that are initialized with a closure whose body is
differentiable. However, function conversion should not be flow
sensitive. This patch removes the hack.
@rxwei rxwei added the tensorflow This is for "tensorflow" branch PRs. label Jun 22, 2019
@rxwei rxwei requested review from dan-zheng and bartchr808 June 22, 2019 02:29
@rxwei
Copy link
Contributor Author

rxwei commented Jun 22, 2019

@swift-ci please test tensorflow

@@ -73,13 +73,6 @@ SimpleMathTests.test("CaptureGlobal") {
expectEqual(30, gradient(at: 0, in: foo))
}

let foo: (Float) -> Float = { x in
Copy link
Contributor

Choose a reason for hiding this comment

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

Move global closure test to test/AutoDiff/autodiff_diagnostics.swift?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm going to do a more comprehensive patch to disable flow-sensitivity for AD function conversion. PR coming soon.

@rxwei rxwei merged commit 8d56a06 into swiftlang:tensorflow Jun 22, 2019
@rxwei rxwei deleted the remove-global-let branch June 22, 2019 10:16
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