Skip to content
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 contiguous and try_contiguous methods #690

Merged
merged 6 commits into from
Apr 11, 2023

Conversation

VasanthakumarV
Copy link
Contributor

Resolves #679,

Used the methodology specified in #679, if I missed something please do let me know.

Comment on lines +242 to +243
let b2: Tensor<_, TestDtype, _> = a.permute::<Rank2<3, 2>, _>().contiguous();
assert_eq!(b2.strides, [2, 1]);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice unit test 👍

Copy link
Owner

@coreylowman coreylowman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really good, will merge once we remove the extra bounds

Copy link
Owner

@coreylowman coreylowman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!

@coreylowman coreylowman merged commit fbe80b4 into coreylowman:main Apr 11, 2023
@VasanthakumarV VasanthakumarV deleted the contiguous branch April 11, 2023 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add contiguous()/try_contiguous() as a method to trait ReshapeTo
2 participants