Rate this Page
โ˜… โ˜… โ˜… โ˜… โ˜…

torch.Tensor.storage_offset#

Tensor.storage_offset() โ†’ int#

Returns self tensorโ€™s offset in the underlying storage in terms of number of storage elements (not bytes).

Example:

>>> x = torch.tensor([1, 2, 3, 4, 5])
>>> x.storage_offset()
0
>>> x[3:].storage_offset()
3