捷徑

torch.Tensor.resize_as_

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

self 張量調整為與指定的 tensor 大小相同。這等同於 self.resize_(tensor.size())

參數

memory_format (torch.memory_format, optional) – Tensor 期望的記憶體格式。預設值:torch.contiguous_format。請注意,如果 self.size()tensor.size() 匹配,則 self 的記憶體格式將不受影響。

文件

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources