bitwise_not¶
dragon.vm.torch.
bitwise_not
(
input,
out=None
)[source]¶Compute the element-wise NOT bitwise operation.
\[\text{out} = \,\,\sim \text{input} \]Examples:
# Typically, ``x`` is a bool tensor print(torch.bitwise_not(torch.tensor([0, 1], 'bool'))) # [True, False] # Otherwise, integral types are required (unsigned or signed) # 00001101 (13) -> 11110010 (?) print(torch.bitwise_not(torch.tensor(13, 'uint8'))) # 242 print(torch.bitwise_not(torch.tensor(13, 'int8'))) # -14
- Parameters:
- input (dragon.vm.torch.Tensor) – The input tensor.
- out (dragon.vm.torch.Tensor, optional) – The output tensor.
- Returns:
dragon.vm.torch.Tensor – The output tensor.