torch.Tensor.storage_offset — PyTorch 2.7 documentation (original) (raw)
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
To analyze traffic and optimize your experience, we serve cookies on this site. By clicking or navigating, you agree to allow our usage of cookies. As the current maintainers of this site, Facebook’s Cookies Policy applies. Learn more, including about available controls: Cookies Policy.