sub

dragon.math.sub(
  inputs,
  **kwargs
)[source]

Compute the element-wise subtraction.

\[\text{out} = a - b \]

Examples:

a = dragon.constant(1)
b = dragon.constant(2)
print(dragon.math.sub([a, b]))
print(a - b)  # Equivalent operation
Parameters:
  • inputs (Sequence[dragon.Tensor]) – The tensor \(a\) and \(b\).
Returns:

dragon.Tensor – The output tensor.