torch.bitwise_left_shift¶
- torch.bitwise_left_shift(input, other, *, out=None) Tensor ¶
计算
input
按other
位进行的算术左移。输入 Tensor 必须是整数类型。此操作符支持 广播到共同形状 和 类型提升。应用的操作是
- 参数
- 关键字参数
out (Tensor, 可选) – 输出 Tensor。
示例
>>> 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)