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