PyTorch torch.bitwise_not function
PyTorch torch reference manual
torch.bitwise_not is a function in PyTorch used for element-wise bitwise NOT.
Function definition
torch.bitwise_not(input, *, out=None)
Usage examples
Example
import
torch
Bitwise NOT example
x
=
torch.
tensor
(
[
0
,
1
,
2
,
3
]
,
dtype
=
torch.
int8
)
result
=
torch.
bitwise_not
(
x
)
(
result
)