torch.bitwise_right_shift
- torch.bitwise_right_shift(input, other, *, out=None) → Tensor
-
计算
input
右算术移位other
位。输入张量必须为整数类型。此操作符支持广播到公共形状和类型提升。如果右操作数的值为负或大于等于左操作数(经过类型提升后)的位数,则行为未定义。执行的操作是:
$\text{out}_i = \text{input}_i >> \text{other}_i$- 参数
- 关键字参数
-
out (Tensor, 可选) – 指定输出张量。
示例:
>>> torch.bitwise_right_shift(torch.tensor([-2, -7, 31], dtype=torch.int8), torch.tensor([1, 0, 3], dtype=torch.int8)) tensor([-1, -7, 3], dtype=torch.int8)