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

Fix update_slice_len calculation in ScatterND #157

Merged
merged 3 commits into from
May 7, 2024
Merged

Conversation

robertknight
Copy link
Owner

@robertknight robertknight commented May 6, 2024

From the spec:

updates is treated as a (q-1)-dimensional tensor of replacement-slice-values.
Thus, the first (q-1) dimensions of updates.shape must match the first
(q-1) dimensions of indices.shape. The remaining dimensions of updates
correspond to the dimensions of the replacement-slice-values

The previous version was wrong, but by serendipity happened to work for existing test cases.

Fix fixes a crash in the ScatterND op I encountered when testing Piper TTS models (see #155).

TODO:

  • Add test

From the spec:

> updates is treated as a (q-1)-dimensional tensor of replacement-slice-values.
> Thus, the first (q-1) dimensions of updates.shape must match the first
> (q-1) dimensions of indices.shape. The remaining dimensions of updates
> correspond to the dimensions of the replacement-slice-values

The previous version was wrong, but happened to work for existing test cases.
@robertknight robertknight merged commit 5d3a0a3 into main May 7, 2024
2 checks passed
@robertknight robertknight deleted the scatternd-fix branch May 7, 2024 05:24
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.

1 participant