Subtract🔗

Subtracts input b from input a element by element.

Inputs🔗

  • a: a numeric (scalar) value, matrix or tensor.

  • b: a numeric (scalar) value, matrix or tensor.

If both a and b are non-scalar (matrix or tensor), their dimensions must be the same.

Outputs🔗

  • result: If both inputs are scalar, the output is a scalar value. If either of the inputs is non-scalar, the output is of the same type as the inputs (i.e. either a matrix or tensor). If one input is scalar and the other input is non-scalar, the output is non-scalar and the values are determined by subtracting each element of the non-scalar input from the scalar input. The number format will be expanded so that there is no loss of accuracy. For example, subtracting an integer from a floating point number returns a floating point number.