[object Object][object Object][object Object]undefined
[object Object]
  • Description: Performs matrix multiplication of tensors self and mat2. Only three-dimensional tensors can be passed. The first dimension is the batch dimension, and the last two dimensions are used for matrix multiplication. Broadcasting is also supported when the batch axis of one input is 1. For details, see the example.

  • Formula:

    out=self@mat2out = self@mat2
  • Example:

    The shape of self is [A, M, K], the shape of mat2 is [A, K, N], and the shape of out is [A, M, N]. The first dimensions are equal, and the last two dimensions are used for matrix multiplication. The shape of self is [A, M, K], the shape of mat2 is [1, K, N], and the shape of out is [A, M, N]. The first dimension of mat2 is 1, which is broadcast to A, and the last two dimensions are used for matrix multiplication. The shape of self is [1, M, K], the shape of mat2 is [B, K, N], and the shape of out is [B, M, N]. The first dimension of self is 1, which is broadcast to B, and the last two dimensions are used for matrix multiplication.

[object Object]

Each operator has calls. First, aclnnBatchMatMulGetWorkspaceSize is called to obtain the input parameters and compute the required workspace size based on the process. Then, aclnnBatchMatMul is called to perform computation.

[object Object]
[object Object]
[object Object]
  • Parameters:

    [object Object]
    • [object Object]Atlas A2 training products/Atlas A2 inference products[object Object], [object Object]Atlas A3 training products/Atlas A3 inference products[object Object], and Ascend 950PR/Ascend 950DT:
      • cubeMathType=1: If the input data type is FLOAT32, it is converted to HFLOAT32 for computation. If the input data type is not FLOAT32, no processing is performed.
      • When cubeMathType is set to 2 and the input data type is FLOAT32, the data type is converted to FLOAT16 for computation. If the input data type is not FLOAT32, no processing is performed.
      • cubeMathType=3: If the input data type is FLOAT32, it is converted to HFLOAT32 for computation. If the input data type is not FLOAT32, no processing is performed.
    • [object Object]Atlas training products[object Object] and [object Object]Atlas inference products[object Object]:
      • The data type BFLOAT16 is not supported.
      • cubeMathType=0 is not supported when the input data type is FLOAT32.
      • cubeMathType=1: If the input data type is FLOAT32, it is converted to FLOAT16 for computation. If the input data type is not FLOAT32, no processing is performed.
      • cubeMathType=3 is not supported.
  • Returns:

    [object Object]: status code. For details, see .

    The first-phase API implements input parameter verification. The following errors may be thrown.

    [object Object]
[object Object]
  • Parameters:

    [object Object]
  • Returns:

    [object Object]: status code. For details, see .

[object Object]
  • Deterministic computation
    • [object Object]Atlas training products[object Object] and [object Object]Atlas inference products[object Object]: aclnnBatchMatMul defaults to a deterministic implementation.
    • For Ascend 950PR/Ascend 950DT, aclnnBatchMatMul is implemented in deterministic mode by default.
[object Object]

The following example is for reference only. For details, see .

[object Object]