评价此页

torch.Tensor.contiguous#

Tensor.contiguous(memory_format=torch.contiguous_format) Tensor#

返回一个内存连续的张量,其中包含与self张量相同的数据。如果self张量已经是指定的内存格式,则此函数返回self张量。

参数

memory_format (torch.memory_format, optional) – 返回张量的期望内存格式。默认值:torch.contiguous_format