mem_size

TensorInfo.mem_size()

Retrieves the memory size (in bytes) allocated for the tensor associated with the current TensorInfo object.

Note

  • To retrieve the actual size of tensor, call tcim_lite.runtime.TensorInfo.size().

  • For tensors stored on Houmo device, the returned memory size may be equal to or larger than the actual size of the tensor due to alignment requirements on Houmo device memory.

  • Only for the contiguous tensor, tcim_lite.runtime.TensorInfo.size() equals to tcim_lite.runtime.TensorInfo.mem_size().

Returns:

size -- The memory size of the tensor.

Return type:

int