torch.Tensor.contiguous¶
- Tensor.contiguous(memory_format=torch.contiguous_format) Tensor¶
返回一個記憶體連續的 Tensor,其中包含與
selfTensor 相同的資料。如果selfTensor 已經是指定的記憶體格式,則此函式返回selfTensor 本身。- 引數
memory_format (
torch.memory_format, 可選) – 返回的 Tensor 所需的記憶體格式。預設值:torch.contiguous_format。