negative

dragon.vm.tensorflow.math.negative(
  x,
  name=None
)[source]

Compute the element-wise negative.

\[\text{out} = -x \]
x = tf.constant([-1, 0, 1])
print(tf.math.negative(x))
Parameters:
  • x (dragon.Tensor) – The input tensor.
  • name (str, optional) – A optional name for the operation.
Returns:

dragon.Tensor – The output tensor.