3 ms·
NumPy has an abstract iterator interface so you don't need to write a kernel with a specific memory layout in mind: http://docs.scipy.org/doc/numpy-1.11.0/refer
by shoyer 10y ago
NumPy has an abstract iterator interface so you don't need to write a kernel with a specific memory layout in mind:
http://docs.scipy.org/doc/numpy-1.11.0/reference/c-api.iterator.html#simple-iteration-example http://docs.scipy.org/doc/numpy-1.11.0/reference/c-api.itera...
For operations like adding two arrays or summing an array along an axis, this means that NumPy automatically iterates in the fastest order.
- m_mueller 10y agoInteresting. How does it decide the storage order when initializing an array? I'd assume due to python's dynamic nature it can't optimize for later operations there, right?
- infinite8s 10y agoIt defaults to row major but you can specify column major on creation.