Skip to content

[AutoDiff] Fix unexpected non-differentiable property access error. #32671

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

Conversation

dan-zheng
Copy link
Contributor

@dan-zheng dan-zheng commented Jul 1, 2020

Mirror of #32670 to master branch.


Add base type parameter to TangentStoredPropertyRequest.

Use TypeBase::getTypeOfMember instead of VarDecl::getType to correctly
compute the member type of original stored properties, using the base type.

Resolves SR-13134.


Fixes tensorflow/swift-apis build regressions:

tensorflow-swift-apis/Tests/ExperimentalTests/ComplexTests.swift:323:18: error: expression is not differentiable
      return lhs.real + rhs.real
                 ^
tensorflow-swift-apis/Tests/ExperimentalTests/ComplexTests.swift:323:18: note: cannot differentiate access to property 'Complex.real' because property type 'T' does not conform to 'Differentiable'
      return lhs.real + rhs.real
                 ^

Add base type parameter to `TangentStoredPropertyRequest`.

Use `TypeBase::getTypeOfMember` instead of `VarDecl::getType` to correctly
compute the member type of original stored properties, using the base type.

Resolves SR-13134.
@dan-zheng dan-zheng requested a review from texasmichelle July 1, 2020 22:46
@dan-zheng dan-zheng added the tensorflow This is for "tensorflow" branch PRs. label Jul 1, 2020
@dan-zheng
Copy link
Contributor Author

Let's merge this PR!
No tests on this PR is fine because the tensorflow-merge -> tensorflow PR #32623 will be tested before it's merged.

@dan-zheng dan-zheng merged commit 2b8c2cf into swiftlang:tensorflow-merge Jul 1, 2020
@dan-zheng dan-zheng deleted the tensorflow-merge-SR13134 branch July 1, 2020 22:49
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.

1 participant