-
Notifications
You must be signed in to change notification settings - Fork 21.7k
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
Add torch.put_along_dim
and torch.put_along_dim_
like np.put_along_axis
#125601
base: main
Are you sure you want to change the base?
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/125601
Note: Links to docs will display an error until the docs builds have been completed. ❌ 51 New FailuresAs of commit bbcf254 with merge base 60bbdc0 (): NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
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.
This looks quite good!
Now, rather than adding a one-off test, could you add an OpInfo within common_methods_invocations.py
. You can even specify a NumPy reference there and a test will test your implementation against it.
Make sure all the relevant tests in test_ops*.py
pass locally before submitting :)
np.put_along_axis(t_np, indices_np, values_np, dim) | ||
self.assertEqual(actual, t_np, atol=0, rtol=0) | ||
|
||
t = torch.tensor([[10, 30, 20], [60, 40, 50]], dtype=dtype) |
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.
can you test the broadcasting behaviour between the different tensors, for both dim
specified and =None
?
Made some of the change and work in progress for OpInfo tests. |
changes so far look good. Thank you! |
Added simple OpInfo test, though one test is failing: |
Fixes #120209
cc @albanD