def buffer_size(v): from array import array as _stdlib_array if PY2 and isinstance(v, _stdlib_array): # pragma: py3 no cover # special case array.array because does not support buffer # interface in PY2 return v.buffer_info()[1] * v.itemsize else: # pragma: py2 no cover v = memoryview(v) return reduce(operator.mul, v.shape) * v.itemsize
def _nchunks(self): return reduce(operator.mul, self._cdata_shape)
def _size(self): return reduce(operator.mul, self._shape)