-
Notifications
You must be signed in to change notification settings - Fork 24.9k
Add discontiguous kwarg to make_tensor #51985
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 discontiguous kwarg to make_tensor #51985
Conversation
[ghstack-poisoned]
💊 CI failures summary and remediationsAs of commit c649550 (more details on the Dr. CI page):
This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.Please report bugs/suggestions to the (internal) Dr. CI Users group. |
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 great. Would you add a test to test_testing.py, like test_make_tensor_discontiguous
, that accepts different input sizes (empty tensor, scalar tensor, single element 1D, single element 2D (1x1), 1D, 2D, 3D) and verifies that this returns a tensor that has the same values but with a discontiguous innermost dimension. It can run on bool, long, float and cfloat.
What does this do for tensors with only a single element?
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
Differential Revision: [D26375733](https://our.internmc.facebook.com/intern/diff/D26375733) [ghstack-poisoned]
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.
Cool! Just add a size check to the test.
Differential Revision: [D26375733](https://our.internmc.facebook.com/intern/diff/D26375733) [ghstack-poisoned]
Differential Revision: [D26375733](https://our.internmc.facebook.com/intern/diff/D26375733) [ghstack-poisoned]
Differential Revision: [D26375733](https://our.internmc.facebook.com/intern/diff/D26375733) [ghstack-poisoned]
Differential Revision: [D26375733](https://our.internmc.facebook.com/intern/diff/D26375733) [ghstack-poisoned]
Differential Revision: [D26375733](https://our.internmc.facebook.com/intern/diff/D26375733) [ghstack-poisoned]
Differential Revision: [D26375733](https://our.internmc.facebook.com/intern/diff/D26375733) [ghstack-poisoned]
Differential Revision: [D26375733](https://our.internmc.facebook.com/intern/diff/D26375733) [ghstack-poisoned]
Differential Revision: [D26375733](https://our.internmc.facebook.com/intern/diff/D26375733) [ghstack-poisoned]
@heitorschueroff merged this pull request in 08d7f29. |
Summary: Pull Request resolved: pytorch#51985 Test Plan: Imported from OSS Reviewed By: mruberry Differential Revision: D26375733 Pulled By: heitorschueroff fbshipit-source-id: bb7831dc28c24b90c6f83885681eeccfdbb83438
Summary: Pull Request resolved: pytorch#51985 Test Plan: Imported from OSS Reviewed By: mruberry Differential Revision: D26375733 Pulled By: heitorschueroff fbshipit-source-id: bb7831dc28c24b90c6f83885681eeccfdbb83438
Stack from ghstack:
Differential Revision: D26375733