[Numpy-discussion] memory layout, K vs C order (was: Numpy 1.6 schedule)

Ralf Gommers ralf.gommers at googlemail.com
Fri Mar 11 04:13:05 EST 2011


On Tue, Mar 8, 2011 at 1:35 AM, Pauli Virtanen <pav at iki.fi> wrote:
>
> Ufuncs don't necessarily return arrays in C-order, but instead
> try to keep the memory layout of the original if it seems
> advantageous vs. memory access.
>
> Before:
>
>>>> np.sin(np.zeros((5,5,5)).transpose(1,2,0)).strides
> (200, 40, 8)
>
> After:
>
>>>> np.sin(np.zeros((5,5,5)).transpose(1,2,0)).strides
> (40, 8, 200)
>
> This gets +1 from me; the drawbacks to this are mostly in code that
> makes too much assumptions and makes no checks.

My conclusion of this discussion was that it can be left as-is. If an
issue turns up during testing of the 1.6.0 beta it can still be
changed. Correct?

Ralf



More information about the NumPy-Discussion mailing list