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.
© 2026, PyTorch Contributors
PyTorch has a BSD-style license, as found in the LICENSE file.
https://docs.pytorch.org/docs/2.14/generated/torch.Tensor.reshape_as.html