torch.ldexp¶ torch.ldexp(input, other, *, out=None) → 张量¶ 将 input 乘以 2 ** other。 outi=inputi∗2iother\text{{out}}_i = \text{{input}}_i * 2^\text{{other}}_i outi=inputi∗2iother通常,此函数用于通过将input中的尾数与从other中的指数创建的二的整数幂相乘来构造浮点数。 Parameters 输入 (张量) – 输入张量。 其他 (张量) – 指数的张量,通常是整数。 Keyword Arguments 输出 (张量, 可选) – 输出张量。 示例: >>> 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.])