Skip to content

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

Closed

Conversation

heitorschueroff
Copy link
Contributor

@heitorschueroff heitorschueroff commented Feb 9, 2021

Stack from ghstack:

Differential Revision: D26375733

@facebook-github-bot
Copy link
Contributor

facebook-github-bot commented Feb 9, 2021

💊 CI failures summary and remediations

As of commit c649550 (more details on the Dr. CI page):


  • 1/1 failures possibly* introduced in this PR
    • 1/1 non-scanned failure(s)

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.

Copy link
Collaborator

@mruberry mruberry left a 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?

Copy link
Collaborator

@mruberry mruberry left a 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.

@facebook-github-bot
Copy link
Contributor

@heitorschueroff merged this pull request in 08d7f29.

@facebook-github-bot facebook-github-bot deleted the gh/heitorschueroff/49/head branch February 28, 2021 15:16
aocsa pushed a commit to Quansight/pytorch that referenced this pull request Mar 15, 2021
Summary: Pull Request resolved: pytorch#51985

Test Plan: Imported from OSS

Reviewed By: mruberry

Differential Revision: D26375733

Pulled By: heitorschueroff

fbshipit-source-id: bb7831dc28c24b90c6f83885681eeccfdbb83438
xsacha pushed a commit to xsacha/pytorch that referenced this pull request Mar 31, 2021
Summary: Pull Request resolved: pytorch#51985

Test Plan: Imported from OSS

Reviewed By: mruberry

Differential Revision: D26375733

Pulled By: heitorschueroff

fbshipit-source-id: bb7831dc28c24b90c6f83885681eeccfdbb83438
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants