mindspore.Tensor.storage_offset

View Source On Gitee
Tensor.storage_offset()[source]

Tensor’s offset in the underlying storage in terms of the number of storage elements.

Returns

int, tensor’s offset in the underlying storage in terms of number of storage elements.

Examples

>>> import mindspore as ms
>>> x = ms.Tensor([1, 2, 3, 4, 5], dtype=ms.float32)
>>> ret = x.storage_offset()
>>> print(ret)
0