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

The discrepancy in strides between numpy and dpnp arrays #1649

Open
chudur-budur opened this issue Jan 3, 2024 · 0 comments
Open

The discrepancy in strides between numpy and dpnp arrays #1649

chudur-budur opened this issue Jan 3, 2024 · 0 comments

Comments

@chudur-budur
Copy link

chudur-budur commented Jan 3, 2024

I think the stride computation in dpnp arrays is not correct.

>>> import numpy as np
>>> import dpnp
>>> a = np.arange(0, 10, dtype=dpnp.int64)
>>> a.strides
(8,)
>>> b = dpnp.arange(0, 10, dtype=dpnp.int64)
>>> b.strides
(1,)
>>> c = np.arange(0, 10, dtype=dpnp.int32)
>>> c.strides
(4,)
>>> d = dpnp.arange(0, 10, dtype=dpnp.int32)
>>> d.strides
(1,)
>>> p = a[::2]
>>> p.strides
(16,)
>>> q = b[::2]
>>> q.strides
(2,)
>>> r = c[::2]
>>> r.strides
(8,)
>>> s = d[::2]
>>> s.strides
(2,)

Why is that?

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

No branches or pull requests

1 participant