-
Notifications
You must be signed in to change notification settings - Fork 2k
[core] Account for both ellipsisMask and begin / end masks in strided slice. #3488
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
Conversation
pyu10055
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 1 approvals obtained (waiting on @annxingyuan and @pyu10055)
tfjs-core/src/ops/slice_util.ts, line 118 at r1 (raw file):
newIndices[ellipsisInsertionIndex] = 0; } else { newIndices.splice(
Since you are iterating from low to high, I am curious why you need to insert and pop from back, can you replace the value at the index with 0?
tfjs-core/src/ops/strided_slice.ts, line 96 at r1 (raw file):
// Normalize the start, end and strides. if (ellipsisAxes.length && numInterpolatedAxes > 0) {
when ellipsis mask is not zero, will the condition be not true?
meaning if the startForAxis and stopForAxis method need the ellipsisMask as parameter?
pyu10055
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for fixing this.
Reviewable status: 0 of 1 approvals obtained (waiting on @annxingyuan and @pyu10055)
annxingyuan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 1 approvals obtained (waiting on @pyu10055)
tfjs-core/src/ops/slice_util.ts, line 118 at r1 (raw file):
Previously, pyu10055 (Ping Yu) wrote…
Since you are iterating from low to high, I am curious why you need to insert and pop from back, can you replace the value at the index with 0?
Done
Thanks for catching this - this logic was leftover from the previous implementation, when newIndices were initialized to begin / end.
tfjs-core/src/ops/strided_slice.ts, line 96 at r1 (raw file):
Previously, pyu10055 (Ping Yu) wrote…
when ellipsis mask is not zero, will the condition be not true?
meaning if the startForAxis and stopForAxis method need the ellipsisMask as parameter?
Sometimes ellipsisAxis.length > 0 but numInterpolatedAxes = 0, this is the case when the ellipsis only applies to one axis because begin / end have the same dimensionality as the input shape.
pyu10055
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
THanks!
To see the logs from the Cloud Build CI, please join either our discussion or announcement mailing list.
This change is