BitwiseNot¶
BitwiseNot - 18¶
Version¶
name: BitwiseNot (GitHub)
domain:
mainsince_version:
18function:
Falsesupport_level:
SupportType.COMMONshape inference:
True
This version of the operator has been available since version 18.
Summary¶
Returns the bitwise not of the input tensor element-wise.
Inputs¶
X (heterogeneous) - T:
Input tensor
Outputs¶
Y (heterogeneous) - T:
Output tensor
Type Constraints¶
T in (
tensor(int16),tensor(int32),tensor(int64),tensor(int8),tensor(uint16),tensor(uint32),tensor(uint64),tensor(uint8)):Constrain input/output to integer tensors.
Examples¶
default¶
import numpy as np
import onnx
node = onnx.helper.make_node(
"BitwiseNot",
inputs=["x"],
outputs=["bitwise_not"],
)
# 2d
x = create_random_int((3, 4), np.int32)
y = np.bitwise_not(x)
expect(node, inputs=[x], outputs=[y], name="test_bitwise_not_2d")
# 3d
x = create_random_int((3, 4, 5), np.uint16)
y = np.bitwise_not(x)
expect(node, inputs=[x], outputs=[y], name="test_bitwise_not_3d")
# 4d
x = create_random_int((3, 4, 5, 6), np.uint8)
y = np.bitwise_not(x)
expect(node, inputs=[x], outputs=[y], name="test_bitwise_not_4d")