invert

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

Invert each bit of input.

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

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 tensor \(x\).
  • name (str, optional) – A optional name for the operation.
Returns:

dragon.Tensor – The output tensor.