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