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