Spec-Zone.ru › PyTorch 2.14

torch.ldexp

torch.ldexp(input, other, *, out=None) → Tensor

Умножает input на 2 ** other.

outi=inputi∗2iother\text{{out}}_i = \text{{input}}_i * 2^\text{{other}}_i

Обычно эта функция используется для построения чисел с плавающей точкой: мантиссы в input умножаются на целые степени двойки, полученные из показателей степени в other.

Параметры:
  • input (Tensor) – входной тензор.
  • other (Tensor) – тензор показателей степени, обычно целых чисел.
Именованные аргументы:

out (Tensor, optional) – выходной тензор.

Пример:

>>> torch.ldexp(torch.tensor([1.]), torch.tensor([1]))
tensor([2.])
>>> torch.ldexp(torch.tensor([1.0]), torch.tensor([1, 2, 3, 4]))
tensor([ 2.,  4.,  8., 16.])

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

Spec-Zone.ru

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