Description: Calculates the size of the space (in the number of elements) required for converting the Matmul operator from the ND format to the NZ format. This API is used only to determine the size required for preprocessing the weight tensor to optimize the execution performance of the Matmul operator. Example:
- When the input shape is [510, 510] and the data type is Float16 or Bfloat16, the function reshapes it to [512, 512].
As a result, the input is interpreted as having 262,144 elements.
When the input shape is [510, 270] and the data type INT8, the function reshapes it to [512, 288]. As a result, the input is interpreted as having 147,456 elements.
Formula:
[object Object]
Parameters:
[object Object](aclIntArray *, computation input): specifies the shape of the weight matrix for the Matmul operation. This parameter corresponds to[object Object]in the formula. It is represented as an aclIntArray on the host side. Only 2D to 6D shapes (batch, n, k) are supported, where[object Object]is the batch size of the weight matrix (0 to 4 dimensions),[object Object]is the size of the first dimension in a single batch, and[object Object]is the size of the second dimension in the single batch. Empty arrays are not supported.[object Object](aclDataType, computation input): data type of the weight tensor. The value can be FLOAT16, BFLOAT16, or INT8.[object Object](uint64_t *, computation output): the size (in number of elements) of the space required for the converted NZ format, corresponding to[object Object]in the formula.
Returns:
- Deterministic computation:
[object Object]defaults to a deterministic implementation.
[object Object]Atlas A3 training products/Atlas A3 inference products[object Object], [object Object]Atlas A2 training products/Atlas A2 inference products[object Object], and [object Object]Atlas inference products[object Object]:
The following is the sample code for a two-dimensional
[object Object], which is for reference only. For details, see . For details about the sample code for a multi-dimensional (3D–6D) tensorShape, see . aclnnWeightQuantBatchMatmulV2 and aclnnWeightQuantBatchMatmulV3 are available for fake quantization. aclnnWeightQuantBatchMatmulV2 is used as an example.[object Object]