Skip to content

Conversation

@hpkfft
Copy link
Contributor

@hpkfft hpkfft commented Mar 22, 2024

In the numpy buffer protocol, strides are measured in bytes. If a stride (in any dimension) is not an integer multiple of itemsize, then the stride cannot be correctly converted to number of elements.

With this PR, a function taking such an nb::ndarray argument will raise a TypeError exception.

@wjakob
Copy link
Owner

wjakob commented Mar 22, 2024

This looks great, thank you! No worries about the failing tests.

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