torch.ravel
-
torch.ravel(input) → Tensor -
Возвращает непрерывный сплющенный тензор. Копия создается только в случае необходимости.
- Параметры:
-
input (Тензор) – входной тензор.
Пример:
>>> t = torch.tensor([[[1, 2], ... [3, 4]], ... [[5, 6], ... [7, 8]]]) >>> torch.ravel(t) tensor([1, 2, 3, 4, 5, 6, 7, 8])
© 2024, PyTorch Contributors
PyTorch has a BSD-style license, as found in the LICENSE file.
https://pytorch.org/docs/1.13/generated/torch.ravel.html