How to get the size of typed memory views in cython

Is it possible to get the memory size in ziton? Ideally, I'm looking for something like arr.shape in numpy.

+6
source share
1 answer

From http://docs.python.org/3.3/library/stdtypes.html#memoryview

len (view) is equal to the length of the list. If view.ndim = 0, the length is 1. If view.ndim = 1, the length is equal to the number of elements in the view. For large sizes, the length is equal to the length of the view of the nested view list. The items attribute will give you the number of bytes in one element.

+6
source

Source: https://habr.com/ru/post/959392/


All Articles