快捷键

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 ,可选) – Tensor 期望的内存格式。默认: torch.contiguous_format 。请注意,如果 self.size()tensor.size() 匹配, self 的内存格式将不受影响。


© 版权所有 PyTorch 贡献者。

使用 Sphinx 构建,并使用 Read the Docs 提供的主题。

文档

PyTorch 的全面开发者文档

查看文档

教程

深入了解初学者和高级开发者的教程

查看教程

资源

查找开发资源并获得您的疑问解答

查看资源