invert

dragon.vm.tensorflow.bitwise.invert(
  x,
  name=None
)[source]

Invert each bit of input.

\[\text{out} = \,\,\sim \text{input} \]

Examples:

# Typically, ``x`` is a bool tensor
print(tf.bitwise.invert(tf.constant([0, 1], 'bool')))  # [True, False]

# Otherwise, integral types are required (unsigned or signed)
# 00001101 (13) -> 11110010 (?)
print(tf.bitwise.invert(tf.constant(13, 'uint8')))  # 242
print(tf.bitwise.invert(tf.constant(13, 'int8')))   # -14
Parameters:
  • x (dragon.Tensor) The input tensor.
  • name (str, optional) The operation name.
Returns:

dragon.Tensor The output tensor.