np.newaxis results in different strides than numpy

Issue #34 resolved
Andreas Kloeckner created an issue

Pypy:

>>>> import numpy as np
>>>> a = np.random.randn(20)
>>>> a[:, np.newaxis].strides
(8, 8)

Plain numpy:

>>> import numpy as np
>>> a = np.random.randn(20)
>>> a[:, np.newaxis].strides
(8, 0)

These are technically equivalent, so PyPy's result is not technically wrong. It's just different from Numpy's. If you're not going for identical behavior in corner cases, feel free to close this.

Comments (1)

  1. Log in to comment