def memory_size_from_info(shape, strides, 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 ) : assert ( len ( shape ) == len ( strides ) ) , '# dim mismatch' ndim = len ( shape ) ( s , e ) = mviewbuf . memoryview_get_extents_info ( shape , strides , ndim , itemsize ) return ( e - s )
et the byte size of a contiguous memory buffer given the shape .