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

[WordSeg] Fix pullback for Array.update(at:to:). #653

Merged
merged 1 commit into from
Jul 31, 2020

Conversation

dan-zheng
Copy link
Member

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

The pullback of Array.update(at:to:) resets dSelf.base[index] to a zero value.

For correctness, it should use the value of self[index].zeroTangentVector before
the update occurs, not dElement.zeroTangentVector.


Fixes WordSegProbeLayerTests.testProbeEncoder after the 2020-07-28 master -> merge.

Previously, the test passed due to an incorrect definition of Array.TangentVector.zeroTangentVectorInitializer, which was fixed in swiftlang/swift#32948.

The pullback of `Array.update(at:to:)` resets `dSelf.base[index]` to a zero value.

For correctness, it should use the value of `self[index].zeroTangentVector` before
the update occurs, not `dElement.zeroTangentVector`.
@dan-zheng dan-zheng requested a review from marcrasi July 31, 2020 19:55
@dan-zheng dan-zheng merged commit 1f27048 into tensorflow:master Jul 31, 2020
@dan-zheng dan-zheng deleted the wordseg-autodiff-fix branch July 31, 2020 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants