Implement copy_, fill_, and ones_like for Nested Tensors backends#87728
Implement copy_, fill_, and ones_like for Nested Tensors backends#87728ani300 wants to merge 1 commit intopytorch:masterfrom
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/87728
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 FailuresAs of commit ecb2460: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
This pull request was exported from Phabricator. Differential Revision: D40689594 |
|
This pull request was exported from Phabricator. Differential Revision: D40689594 |
c2501e4 to
2e17d4b
Compare
torch/nested/__init__.py
Outdated
There was a problem hiding this comment.
I think it was done automatically from a linter suggestion, I can revert it
test/test_nestedtensor.py
Outdated
There was a problem hiding this comment.
Can we add unit tests for these ops?
|
This pull request was exported from Phabricator. Differential Revision: D40689594 |
2e17d4b to
76cbd0d
Compare
|
This pull request was exported from Phabricator. Differential Revision: D40689594 |
76cbd0d to
ee0b19b
Compare
There was a problem hiding this comment.
This won't work if value is anything but a scalar. In the test you only test it with scalar. Do you need to support this overload for your use case?
There was a problem hiding this comment.
No. I can add the test that fails with a non-0-dimensional tensor too. I think the reason this exists is so that you can do something like t.fill_(other_t[0]), which returns a 0-dimensional tensor instead of a scalar.
…torch#87728) Summary: Pull Request resolved: pytorch#87728 This diff implements copy_ in order to allow pinned memory transfers for nested tensors, as well as fill_ and ones_like, to test whether nested tensors can be created with other factory functions. Test Plan: Pass all CI and sandcastle jobs. Reviewed By: mikekgfb Differential Revision: D40689594 fbshipit-source-id: f1e180b40d1c7317768da7bc8f8abd68ab26dd6b
|
This pull request was exported from Phabricator. Differential Revision: D40689594 |
ee0b19b to
ecb2460
Compare
|
@pytorchbot merge -f "unrelated failure" |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
|
Hey @ani300. |
…torch#87728) Summary: This diff implements copy_ in order to allow pinned memory transfers for nested tensors, as well as fill_ and ones_like, to test whether nested tensors can be created with other factory functions. Test Plan: Pass all CI and sandcastle jobs. Reviewed By: mikekgfb Differential Revision: D40689594 Pull Request resolved: pytorch#87728 Approved by: https://github.com/cpuhrsch
…torch#87728) Summary: This diff implements copy_ in order to allow pinned memory transfers for nested tensors, as well as fill_ and ones_like, to test whether nested tensors can be created with other factory functions. Test Plan: Pass all CI and sandcastle jobs. Reviewed By: mikekgfb Differential Revision: D40689594 Pull Request resolved: pytorch#87728 Approved by: https://github.com/cpuhrsch
Summary: This diff implements copy_ in order to allow pinned memory transfers for nested tensors, as well as fill_ and ones_like, to test whether nested tensors can be created with other factory functions.
Test Plan: Pass all CI and sandcastle jobs.
Reviewed By: mikekgfb
Differential Revision: D40689594