Skip to content

Basic ndarray.flags implementation #49

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

Merged
merged 3 commits into from
Feb 13, 2023
Merged

Conversation

honno
Copy link
Contributor

@honno honno commented Feb 9, 2023

Implements x.flags, which mostly raises NotImplementedError(). Seemed nice if just for porting NumPy's own tests.

if flag_to_value["C_CONTIGUOUS"]:
# There's no proper way to determine if a tensor is Fortran-style
# contiguous in torch, but at least we know it isn't when it is
# C-style.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Strictly speaking, 1D arrays can be both C and F contiguous. Not sure how deep into that rabbit hole we need fall though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh right—this was a bit magical to begin with so removed.

@ev-br ev-br merged commit ef2e852 into Quansight-Labs:main Feb 13, 2023
@ev-br
Copy link
Collaborator

ev-br commented Feb 13, 2023

LET'S, so let's get this in to keep the ball rolling. Thanks @honno

@honno honno mentioned this pull request Feb 20, 2023
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.

2 participants