rydiqule.slicing.slicing.memory_size

rydiqule.slicing.slicing.memory_size(shape: Tuple[int, ...], item_size: int) int[source]

Calculate the memory size, in bytes of an array with the given size and shape. Does not calculate the actual array, just theoretical size since this function is intended to be used before attempting allocate an array that is too large.

Parameters:
  • shape (list-like) – Shape of the array in question.

  • item_size (int) – Size of an array element in bytes.

Returns:

Expected memory size of array in bytes

Return type:

int