Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PyTorch torch.bitwise_right_shift function

PyTorch torch.bitwise_right_shift function

PyTorch torch.bitwise_right_shift function


PyTorch torch reference manual PyTorch torch reference manual

torch.bitwise_right_shift is a function in PyTorch used for element-wise right shift.

Function definition

torch.bitwise_right_shift(input, other, *, out=None)


Usage examples

Example

import

torch

Right shift example

x

=

torch.

tensor

(

[

2

,

4

,

6

,

8

]

,

dtype

=

torch.

int8

)

result

=

torch.

bitwise_right_shift

(

x

,

1

)

print

(

result

)

 

tensor([1, 2, 3, 4], dtype=int8)


PyTorch torch reference manual PyTorch torch reference manual