sub

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

Atlas inference product

Atlas training product

Function Usage

Subtracts two tensors.

Prototype

1
sub(other: Union[TensorHolder, TensorLike]) -> TensorHolder

Parameters

Parameter

Input/Output

Description

other

Input

Another tensor holder or similar tensor object.

Returns

(TensorHolder) New tensor holder of the result.

Restrictions

  • If other is not a TensorHolder, TypeError is thrown.
  • If the operation fails or the library is unavailable, RuntimeError is thrown.
  • The - operator can be overloaded.