快捷方式

torch.Tensor.reshape_as

Tensor.reshape_as(other) Tensor

返回与 other 形状相同的张量。self.reshape_as(other) 等价于 self.reshape(other.sizes())。如果 other.sizes() 与当前形状兼容,则此方法返回视图。有关何时可能返回视图,请参阅 torch.Tensor.view()

有关 reshape 的更多信息,请参阅 reshape()

参数

other (torch.Tensor) – 结果张量与 other 具有相同的形状。

文档

访问 PyTorch 的全面开发者文档

查看文档

教程

获取面向初学者和高级开发者的深入教程

查看教程

资源

查找开发资源并获得问题解答

查看资源