PyTorch torch.bitwise_left_shift function
PyTorch torch reference manual
torch.bitwise_left_shift is a function in PyTorch used for element-wise left shift.
Function definition
torch.bitwise_left_shift(input, other, *, out=None)
Usage examples
Example
import
torch
Left shift example
x
=
torch.
tensor
(
[
1
,
2
,
3
,
4
]
,
dtype
=
torch.
int8
)
result
=
torch.
bitwise_left_shift
(
x
,
1
)
(
result
)