-
Notifications
You must be signed in to change notification settings - Fork 26.3k
add support for steps(strides) in tensor slices #20929
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
suo
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.
looks good! Sorry for the wait
|
|
||
| auto has_step = slice.step().present(); | ||
| // TODO: add support for slicing tuples | ||
| if (has_step) |
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.
nit: formatting
torch/csrc/jit/script/compiler.cpp
Outdated
| // TODO: add support for slicing tuples | ||
| if (has_step) | ||
| { | ||
| throw ErrorReport(loc) << "Unsupported operation: slicing tuples isn't supported"; |
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.
I think this error message is not accurate, right? We do support tuple slices, just not steps
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.
will fix.
torch/csrc/jit/script/compiler.cpp
Outdated
| } | ||
| } | ||
|
|
||
| auto stride = emitExpr(Expr(slice.stepOr(1))); |
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.
nit: "stride" is a heavyweight term in pytorch, let's avoid it and stick with step
facebook-github-bot
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.
@Krovatkin has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
@Krovatkin merged this pull request in 5b4a188. |
No description provided.