Spec-Zone.ru › PyTorch 2

torch.broadcast_to

torch.broadcast_to(input, shape) → Tensor

Распространяет input на форму shape. Эквивалентно вызову input.expand(shape). Подробности см. в expand().

Параметры
  • input (Tensor) – входной тензор.
  • shape (список, кортеж или torch.Size) – новая форма.

Пример:

>>> x = torch.tensor([1, 2, 3])
>>> torch.broadcast_to(x, (3, 3))
tensor([[1, 2, 3],
        [1, 2, 3],
        [1, 2, 3]])

© 2024, PyTorch Contributors
PyTorch has a BSD-style license, as found in the LICENSE file.
https://pytorch.org/docs/2.1/generated/torch.broadcast_to.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API