Skip to content
This repository was archived by the owner on Apr 23, 2025. It is now read-only.

[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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants