torch.bitwise_right_shift¶
- torch.bitwise_right_shift(input, other, *, out=None) 张量 ¶
计算
input
右移other
位的算术移位。 输入张量必须是整数类型。此操作符支持 广播到公共形状 和 类型提升。 在任何情况下,如果右操作数的值为负或大于等于提升后的左操作数的位数,则行为未定义。应用的操作是:
示例:
>>> 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)