torch.Tensor.storage_offset
-
Tensor.storage_offset() → int -
Возвращает смещение
selfтензора в базовом хранилище в количестве элементов хранилища (не байтов).Пример:
>>> x = torch.tensor([1, 2, 3, 4, 5]) >>> x.storage_offset() 0 >>> x[3:].storage_offset() 3
© 2026, PyTorch Contributors
PyTorch has a BSD-style license, as found in the LICENSE file.
https://docs.pytorch.org/docs/2.14/generated/torch.Tensor.storage_offset.html