Description: Performs matrix multiplication on tensors x1 and x2. Only three-dimensional tensors can be passed. Tensors can be transposed. The transposition sequence is changed based on the input sequence. permX1 indicates the transposition sequence of tensor x1, and permX2 indicates the transposition sequence of tensor x2. The sequence value 0 indicates the batch dimension, and the other two dimensions are used for matrix multiplication.
Example:
- If the shape of x1 is (B, M, K), the shape of x2 is (B, K, N), scale is None, and batchSplitFactor is 1, the shape of the output out is (M, B, N).
- If the shape of x1 is (B, M, K), the shape of x2 is (B, K, N), scale is not None, and batchSplitFactor is 1, the shape of the output out is (M, 1, B * N).
- If the shape of x1 is (B, M, K), the shape of x2 is (B, K, N), scale is None, and batchSplitFactor is greater than 1, the shape of the output out is (batchSplitFactor, M, B * N / batchSplitFactor).
Each operator has calls. First, aclnnTransposeBatchMatMulGetWorkspaceSize is called to obtain the input parameters and compute the required workspace size based on the process. Then, aclnnTransposeBatchMatMul is called to perform computation.
Parameters:
[object Object]Returns:
aclnnStatus: status code. For details, see .
The first-phase API implements input parameter verification. The following errors may be thrown:
[object Object]
Deterministic description:
- [object Object]Atlas training series products[object Object] and [object Object]Atlas inference series products[object Object]: aclnnTransposeBatchMatMul defaults to a deterministic implementation.
[object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training series products/Atlas A3 inference series products[object Object]:
- The value range of B is [1, 65536), and the value range of N is [1, 65536).
- When the input shape of x1 is (B, M, K), K ≤ 65535. When the input shape of x1 is (M, B, K), B × K ≤ 65535.
- permX2 supports only the input [0, 1, 2].
- When scale is not null, the product of B and N must be less than 65,536, and type deduction cannot be performed only when the input is FLOAT16 and the output is INT8.
The following example is for reference only. For details, see .