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