评价此页

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 相同。