torch.ldexp
- torch.ldexp(input, other, *, out=None) → Tensor
Multiplies
inputby 2 **.
Multiplies input by 2 ** .
Typically this function is used to construct floating point numbers by multiplying
mantissas in input with integral powers of two created from the exponents
in other.
Example:
>>> 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.])