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

Skip stride check if shape is 1 in IsContiguous #13121

Merged
merged 1 commit into from
Oct 19, 2022

Conversation

yelite
Copy link
Contributor

@yelite yelite commented Oct 18, 2022

Skip stride check if shape[k] is 1, where the dimension is contiguous regardless of the value of stride.

For example, PyTorch will normalize stride to 1 if shape is 1.
Related: pytorch/pytorch@ec42ee0

cc @junrushao @zxybazh

@tvm-bot
Copy link
Collaborator

tvm-bot commented Oct 18, 2022

Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.

  • No users to auto-tag found, no teams are specified in PR title See #10317 for details
  • Built docs for commit 89723a3 can be found here.

Generated by tvm-bot

Copy link
Member

@junrushao junrushao left a comment

Choose a reason for hiding this comment

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

Please also add a unittest

@github-actions github-actions bot requested a review from zxybazh October 18, 2022 16:20
@zxybazh
Copy link
Member

zxybazh commented Oct 18, 2022

Hi Lite, can you please fix the linting issue?

@yelite yelite force-pushed the fix-ndarray-contiguous-check branch from 6ae6202 to 64d3843 Compare October 18, 2022 18:38
Skip stride check if shape[k] is 1, where the dimension is contiguous
regardless of the value of stride.

For example, PyTorch will normalize stride to 1 if shape is 1.
@yelite yelite force-pushed the fix-ndarray-contiguous-check branch from 64d3843 to 89723a3 Compare October 18, 2022 19:20
@yelite
Copy link
Contributor Author

yelite commented Oct 18, 2022

I fixed lint and added few unit tests

Copy link
Member

@zxybazh zxybazh left a comment

Choose a reason for hiding this comment

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

LGTM.

@masahi masahi merged commit 0b48367 into apache:main Oct 19, 2022
xinetzone pushed a commit to daobook/tvm that referenced this pull request Nov 10, 2022
Skip checking stride if shape is 1 in IsContiguous

Skip stride check if shape[k] is 1, where the dimension is contiguous
regardless of the value of stride.

For example, PyTorch will normalize stride to 1 if shape is 1.
xinetzone pushed a commit to daobook/tvm that referenced this pull request Nov 25, 2022
Skip checking stride if shape is 1 in IsContiguous

Skip stride check if shape[k] is 1, where the dimension is contiguous
regardless of the value of stride.

For example, PyTorch will normalize stride to 1 if shape is 1.
ghost pushed a commit to neo-ai/tvm that referenced this pull request Jan 4, 2023
Skip checking stride if shape is 1 in IsContiguous

Skip stride check if shape[k] is 1, where the dimension is contiguous
regardless of the value of stride.

For example, PyTorch will normalize stride to 1 if shape is 1.
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.

5 participants