def memory_size_from_info(shape, strides, itemsize): """et the byte size of a contiguous memory buffer given the shape, strides and itemsize. """ assert len(shape) == len(strides), "# dim mismatch" ndim = len(shape) s, e = mviewbuf.memoryview_get_extents_info(shape, strides, ndim, itemsize) return e - s
def memory_size_from_info(shape, strides, itemsize): """et the byte size of a contiguous memory buffer given the shape, strides and itemsize. """ assert len(shape) == len(strides), "# dim mismatch" ndim = len(shape) s, e = mviewbuf.memoryview_get_extents_info(shape, strides, ndim, itemsize) return e - s