Shortcuts

torch.Tensor.resize_as_

Tensor.resize_as_(tensor, memory_format=torch.contiguous_format) 张量

self张量调整为与指定的 tensor相同的大小。这等效于self.resize_(tensor.size())

Parameters

memory_format (torch.memory_format, 可选) – 期望的张量内存格式。默认值:torch.contiguous_format。注意,如果 self.size()tensor.size() 匹配,则 self 的内存格式将不受影响。

优云智算