-
Notifications
You must be signed in to change notification settings - Fork 64
Add support for _unsafe_index_put #1314
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
@@ -863,6 +863,14 @@ def _where_input_wrangler( | |||
matcher=lambda sample: not (sample.args[0][0].dtype == torch.int64), | |||
reason="this Aten overload only supports tensor(int) as indices", | |||
) | |||
TorchLibOpInfo( | |||
"_unsafe_index_put", |
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.
Since it looks like it is the same as index_put, we can actually make it the same function.
If for any reason we believe they could behave differently or if we want to safeguard the implementation, I would create test cases in extra_opinfo.py
to run it against torch.ops.aten._unsafe_index_put
(Looks like _unsafe_index_put does not exist in https://github.com/pytorch/pytorch/blob/main/torch/testing/_internal/common_methods_invocations.py so we may need to create our own test cases)
Curious what is unsafe about this op itself? |
Co-authored-by: Justin Chu <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1314 +/- ##
===========================================
- Coverage 78.68% 62.08% -16.61%
===========================================
Files 119 117 -2
Lines 15762 14922 -840
Branches 2486 2372 -114
===========================================
- Hits 12403 9264 -3139
- Misses 2950 5318 +2368
+ Partials 409 340 -69 ☔ View full report in Codecov by Sentry. |
Dropped for #1315. |
No description provided.