torch.bitwise_left_shift¶
- torch.bitwise_left_shift(input, other, *, out=None) Tensor ¶
计算操作符
input
的左算术移位other
位。输入张量必须是整型。此操作符支持广播到公共形状和类型提升。使用的操作是:
- 参数:
输入(张量或标量)- 第一个输入张量
其他(张量或标量)- 第二个输入张量
- 关键字参数:
输出(张量,可选)- 输出张量。
示例:
>>> torch.bitwise_left_shift(torch.tensor([-1, -2, 3], dtype=torch.int8), torch.tensor([1, 0, 3], dtype=torch.int8)) tensor([-2, -2, 24], dtype=torch.int8)