Operator APIs (aclnn)
Instructions
To make it easier to call operators, a set of C-based APIs (with the aclnn prefix) are provided. You do not need to provide the Intermediate Representation (IR) definition to facilitate efficient model and application development. This method is called single-operator API calling, or aclnn calling for short.
Header File/Library File
When calling operator APIs, you need to reference the dependency header file and library file. Generally, the header file is stored in
${INSTALL_DIR}/include/aclnnopand the library file is stored in${INSTALL_DIR}/lib64.- Header file: 1. Method 1 (recommended): Reference the general header file
aclnn_ops_{ops_project}.hof the operator repository. 2. Method 2: Reference the header file aclnn_*.h of a single operator API. - Library file: The library file libopapi_${ops_project}.so corresponding to the operator repository is referenced. Note that the original operator repository file libopapi.so will be deprecated and is not recommended. It cannot be used together with a single operator repository file.
${INSTALL_DIR} indicates the file path after CANN installation. ${ops_project} indicates the operator repository name (such as math, nn, cv, and transformer). Change it to the actual operator repository name.
- Header file: 1. Method 1 (recommended): Reference the general header file
Version Evolution
Note that some APIs have multiple versions. Select the latest version. (APIs of a later version are compatible with all capabilities of APIs of an earlier version.)
API List
- Operator Features: Before calling an API, you need to learn the basic knowledge of operators, including Deterministic Algorithms, Batch Consistency, and Common Quantization Modes. For details, see Basic Concepts of Operators.
- Symbol description: The hyphen (-) in the table indicates that the API does not support the current product.
The following table lists the operator APIs.
| API Name | Description | Determinism (A2/A3) | Determinism (Ascend 950) |
|---|---|---|---|
| aclnnAbs | Calculates the absolute value of a tensor. | Enabled by default | Enabled by default |
| aclnnAcos&aclnnInplaceAcos | Performs the arc cosine operation on each element of the input matrix and outputs the result. | Enabled by default | Enabled by default |
| aclnnAcosh&aclnnInplaceAcosh | Performs the inverse hyperbolic cosine operation on each element of the input tensor and outputs the result. | Enabled by default | Enabled by default |
| aclnnAdd&aclnnInplaceAdd | Performs the addition computation. | Enabled by default | Enabled by default |
| aclnnAddcdiv&aclnnInplaceAddcdiv | Performs the addition computation. | Enabled by default | Enabled by default |
| aclnnAddcmul&aclnnInplaceAddcmul | Multiplies tensor 1 and tensor 2 element by element, multiplies the result by the scalar value, and adds the result to the input self/selfRef element by element. | Enabled by default | Enabled by default |
| aclnnAddLora | Adds the Low-Rank Adaptation (LoRA) layer to a neural network to reduce the number of parameters through low-rank factorization. | Enabled by default | - |
| aclnnAddN | Adds the main elements of the input. | Enabled by default | Enabled by default |
| aclnnAddr&aclnnInplaceAddr | Calculates the outer product of the one-dimensional vectors vec1 and vec2 to obtain a two-dimensional matrix, multiply the result matrix of the outer product by a coefficient, add the result matrix by the coefficient, and output the result. | Enabled by default | Enabled by default |
| aclnnAdds&aclnnInplaceAdds | Performs the addition computation. | Enabled by default | Enabled by default |
| aclnnAddV3&aclnnInplaceAddV3 | Performs the addition computation. | - | Enabled by default |
| aclnnAffineGrid | Given a group of 3-dimensional affine parameter matrices (theta) and a size (size) of an output image, a 2D or 3D grid is generated. The grid represents coordinates of a point of an affine image on an original image. | Enabled by default | - |
| aclnnAll | For each dimension in the given dimension dim, if all elements in the dimension of the input tensor are calculated as True, True is returned. Otherwise, False is returned. | Enabled by default | Enabled by default |
| aclnnAmax | Returns the maximum value of each slice of a tensor in a specified dimension (specified by dim). | Enabled by default | Enabled by default |
| aclnnAmin | Returns the minimum value of each slice of a tensor in a specified dimension (specified by dim). | Enabled by default | Enabled by default |
| aclnnAminmax | Returns the minimum and maximum values of each row of the input tensor in the specified dimension. | Enabled by default | Enabled by default |
| aclnnAminmaxAll | Returns the minimum and maximum values of the input tensor in all dimensions. | Enabled by default | Enabled by default |
| aclnnAminmaxDim | Returns the minimum and maximum values of the input tensor in specified dimensions. | Enabled by default | Enabled by default |
| aclnnAngleV2 | Angle of each element of the input tensor (unit: radian). | Enabled by default | Enabled by default |
| aclnnAny | For each dimension in the given dimension dim, if any element in the dimension of the input tensor is calculated as True, True is returned. Otherwise, False is returned. | Enabled by default | Enabled by default |
| aclnnArange | Obtains values from start to end at intervals specified by step and saves the values to the output 1D tensor. The data range is [start, end). | Enabled by default | Enabled by default |
| aclnnArgMax | Returns the maximum value index of a tensor in a specified dimension (dim) and saves it to the out tensor. | Enabled by default | Enabled by default |
| aclnnArgMin | Returns the minimum value index of the specified axis in the tensor and saves it to out. | Enabled by default | Enabled by default |
| aclnnArgsort | Sorts elements of the input tensor in ascending or descending order along a specified dimension, and returns the corresponding indices. | Enabled by default | Enabled by default |
| aclnnAsin&aclnnInplaceAsin | Performs the arcsine operation on each element of the input matrix and outputs the result. | Enabled by default | Enabled by default |
| aclnnAsinh&aclnnInplaceAsinh | Computes the inverse hyperbolic sine of each element in the input tensor. | Enabled by default | Enabled by default |
| aclnnAtan&aclnnInplaceAtan | Computes the arctangent of each element in the input matrix. | Enabled by default | Enabled by default |
| aclnnAtan2&aclnnInplaceAtan2 | Performs the element-wise arctangent operation on the input tensors self and other. | Enabled by default | Enabled by default |
| aclnnAtanh&aclnnInplaceAtanh | Performs the inverse hyperbolic tangent operation on each element in the input tensor and outputs the result. | Enabled by default | Enabled by default |
| aclnnBatchNormStats | Computes the mean value and the reciprocal of the standard deviation for the input data of a single card. | Enabled by default | Enabled by default |
| aclnnBernoulli&aclnnInplaceBernoulli | Extracts binary random numbers (0 or 1) from the Bernoulli distribution. prob is the probability of generating binary random numbers. The input tensor is used to specify the shape. | Enabled by default | Enabled by default |
| aclnnBernoulliTensor&aclnnInplaceBernoulliTensor | Extracts binary random numbers (0 or 1) from the Bernoulli distribution. prob is the probability of generating binary random numbers. The input tensor is used to specify the shape. | Enabled by default | Enabled by default |
| aclnnBincount | Computes the frequency of each number in a non-negative integer array. | Enabled by default | Disabled by default. Can be enabled. |
| aclnnBitwiseAndScalar | Computes the bitwise AND result of each element in the input tensor and the input scalar. | Enabled by default | Enabled by default |
| aclnnBitwiseAndTensor | Performs the logical AND operation when the input is a Boolean tensor; performs bitwise AND operation when the input is of the INT type. | Enabled by default | Enabled by default |
| aclnnBitwiseAndTensorOut&aclnnInplaceBitwiseAndTensorOut | Performs the logical AND operation when the input is a Boolean tensor; performs bitwise AND operation when the input is of the INT type. | - | Enabled by default |
| aclnnBitwiseNot | Performs the logical NOT operation when the input is a BOOL tensor; performs bitwise NOT operation when the input is of the INT type. | Enabled by default | Enabled by default |
| aclnnBitwiseOrScalar&aclnnInplaceBitwiseOrScalar | Computes the bitwise OR between elements in the input tensor self and the input scalar other. | Enabled by default | Enabled by default |
| aclnnBitwiseOrTensor&aclnnInplaceBitwiseOrTensor | Computes the bitwise OR between elements in the tensor self and corresponding elements in the tensor other. | Enabled by default | Enabled by default |
| aclnnBitwiseXorScalar&aclnnInplaceBitwiseXorScalar | Computes the bitwise XOR between elements in the input tensor self and the input scalar other. The input self and other must be of the INT or BOOL type. For the BOOL type, the operator computes the logical XOR. | Enabled by default | Enabled by default |
| aclnnBitwiseXorTensor&aclnnInplaceBitwiseXorTensor | Computes the bitwise XOR between elements in the input tensor self and corresponding elements in the input tensor other. The input self and other must be of the INT or BOOL type. For the BOOL type, the operator computes the logical XOR. | Enabled by default | Enabled by default |
| aclnnCalculateConvolutionWeightSize | Calculates the weight size to be requested under the NCHW input of the Convolution operator. Only the Float16 type is supported. This API is only used to determine the size required for preprocessing the weight tensor, in order to achieve the optimal execution performance of the Convolution operator. | Enabled by default | - |
| aclnnCalculateMatmulWeightSize | Calculates the size of the weight to be allocated when the Matmul operator is in ND format. This API is used only to determine the size required for preprocessing the weight tensor to achieve optimal Matmul operator execution performance. | Enabled by default | Enabled by default |
| aclnnCalculateMatmulWeightSizeV2 | 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. | Enabled by default | Enabled by default |
| aclnnCast | Converts the tensor data type. | Enabled by default | Enabled by default |
| aclnnCat | Concatenates all tensors in the tensor list by dim. | Enabled by default | Enabled by default |
| aclnnCdist | Calculates the p-norm distance between points in two vector sets. | Enabled by default | - |
| aclnnCdistBackward | Reverses aclnnCdist. | Enabled by default | Enabled by default |
| aclnnCeil&aclnnInplaceCeil | Returns the round-up result of each element in the input tensor. | Enabled by default | Enabled by default |
| aclnnChannelShuffle | Divides the channels of the (*, C, H, W) tensor into g groups, randomly rearranges the channels in each channel group, combines all the channels, and outputs the result while keeping the shape of the final output tensor the same as that of the input tensor. | Enabled by default | Enabled by default |
| aclnnChunkCat | Splits all tensors in tensors into numChunks blocks based on the dimension dim, concatenates the blocks based on the next dimension, and converts the blocks into the out data type. | Enabled by default | Enabled by default |
| aclnnCircularPad2d | Pads the last two dimensions of the input tensor using circular padding of the input boundary. | Enabled by default | Enabled by default |
| aclnnCircularPad2dBackward | Performs backpropagation of circular_pad2d. For details about the forward propagation, see aclnnCircularPad2d. | Enabled by default | Enabled by default |
| aclnnCircularPad3d | Pads the last three dimensions of the input tensor using circular padding of the input boundary. | Enabled by default | Enabled by default |
| aclnnCircularPad3dBackward | Performs backpropagation of aclnnCircularPad3d. | Enabled by default | Enabled by default |
| aclnnClamp | Limits all input elements within the range of [min, max]. If min is None, there is no lower limit. If max is None, there is no upper limit. | Enabled by default | Enabled by default |
| aclnnClampMax&aclnnInplaceClampMax | Limits all input elements within the range of [-inf, max]. | Enabled by default | Enabled by default |
| aclnnClampMaxTensor&aclnnInplaceClampMaxTensor | Limits all input elements within the range of [-inf, max]. | Enabled by default | Enabled by default |
| aclnnClampMin | Limits all input elements within the range of [min, inf]. | Enabled by default | Enabled by default |
| aclnnClampMinTensor&aclnnInplaceClampMinTensor | Limits all input elements within the range of [min, inf]. | Enabled by default | Enabled by default |
| aclnnClampTensor | Limits all input elements within the range of [min, max]. If min is not set, there is no lower limit. If max is not set, there is no upper limit. | Enabled by default | Enabled by default |
| aclnnComplex | Two input tensors with the same shape, broadcast relationship, and Dtype. | Enabled by default | Enabled by default |
| aclnnConfusionTranspose | Fuses the reshape and transpose operations. | Enabled by default | Enabled by default |
| aclnnConstantPadNd | Pads the input tensor self with data based on the pad parameter. The padded data is specified by value. | Enabled by default | Enabled by default |
| aclnnCos&aclnnInplaceCos | Performs the cosine operation on each element of the input matrix and outputs the result. | Enabled by default | Enabled by default |
| aclnnCosh&aclnnInplaceCosh | Functions as a hyperbolic function, which returns a new tensor based on the formula. The shape of the result is the same as that of the input tensor. | Enabled by default | Enabled by default |
| aclnnCummax | Computes the cumulative maximum value in self and returns the maximum value and the corresponding index. | Enabled by default | - |
| aclnnCummin | Computes the cumulative minimum value in self and returns the minimum value and the corresponding index. | Enabled by default | Enabled by default |
| aclnnCumprod&aclnnInplaceCumprod | The aclnnCumprod API is added. The cumprod function is used to calculate the cumulative product of the input tensor in a specified dimension. | Enabled by default | - |
| aclnnCumsum | Computes the cumulative sum of the elements of the input tensor self in sequence based on the specified dim and saves the result to the output tensor out. | Enabled by default | Enabled by default |
| aclnnCumsumV2 | Computes the cumulative sum of the elements of the input tensor self in sequence based on the specified dim and saves the result to the output tensor out. | Enabled by default | Enabled by default |
| aclnnDiag | If the input is a vector (one-dimensional vector), a two-dimensional matrix tensor is returned, where the input element is a diagonal. If the input is a two-dimensional tensor, a one-dimensional vector is output, and a value is a diagonal element of the input matrix specified by diagonal. | Enabled by default | Enabled by default |
| aclnnDiagFlat | Generates a diagonal tensor. If the input self is a one-dimensional tensor, a two-dimensional tensor is returned, where the elements in self are the diagonal values. If the input self is a two-dimensional or higher-dimensional tensor, it is first flattened (simplified into a one-dimensional tensor) and then processed in the first scenario. | Enabled by default | Enabled by default |
| aclnnDigamma | Performs the digamma mathematical operation on each element of the input tensor. | Enabled by default | Enabled by default |
| aclnnDiv&aclnnInplaceDiv | Performs division. | Enabled by default | Enabled by default |
| aclnnDivMod&aclnnInplaceDivMod | Performs the division operation and selects the rounding operation based on the mode parameter. | Enabled by default | Enabled by default |
| aclnnDivMods&aclnnInplaceDivMods | Performs the division operation and selects the rounding operation based on the mode parameter. | Enabled by default | Enabled by default |
| aclnnDivs&aclnnInplaceDivs | Performs division. | Enabled by default | Enabled by default |
| aclnnDot | Computes the dot product of two 1D tensors. | Enabled by default | Enabled by default |
| aclnnDropout | In a training process, an element in the input is randomly set to zero based on a probability p, and the output is scaled in a ratio of 1/ (1 - p). | Enabled by default | - |
| aclnnDropoutBackward | During training, set the input elements to zero based on the value of the corresponding bit in the mask, and scale up or set the elements to zero based on the scale. If a bit in mask is 1, the corresponding gradOutput element is scaled; if a bit in mask is 0, the corresponding gradOutput element is zeroed. Specially, if scale is 0, all elements are zeroed; if scale is 1, the gradOutput elements remain unchanged. You are advised to use it together with aclnnDropoutGenMask or aclnnDropoutGenMaskV2. | Enabled by default | Enabled by default |
| aclnnDropoutDoMask | Randomly zeros the elements in the input based on the probability prob, and amplifies the output based on the ratio of 1/ (1 - prob). | Enabled by default | Enabled by default |
| aclnnDropoutGenMask | During training, a mask is generated based on the probability prob for element zeroing. | Enabled by default | Enabled by default |
| aclnnDropoutGenMaskV2 | During training, a mask is generated based on the probability prob for element zeroing. | Enabled by default | Enabled by default |
| aclnnDropoutGenMaskV2Tensor | During training, a mask is generated based on the probability prob for element zeroing. | Enabled by default | Enabled by default |
| aclnnDropoutV3 | Randomly zeros the elements in the input based on the probability p, and scales the output based on the ratio of 1/ (1 - p). | Enabled by default | Enabled by default |
| aclnnDropoutV3Grad | Zeros the elements in the input based on the input mask and scales the output based on the scale. | - | Enabled by default |
| aclnnEqScalar&aclnnInplaceEqScalar | Compares the values of elements in self with those in other, and writes the comparison result to out. | Enabled by default | Enabled by default |
| aclnnEqTensor&aclnnInplaceEqTensor | Checks whether the elements in two tensors are equal. If a tensor with self=other is returned, the value is True(1.); otherwise, the value is False(0.). | Enabled by default | Enabled by default |
| aclnnEqual | Checks whether two tensors have the equal size and elements. A Boolean value is returned. | Enabled by default | Enabled by default |
| aclnnErf&aclnnInplaceErf | Returns the value of the error function corresponding to each element in the input tensor. | Enabled by default | Enabled by default |
| aclnnErfc&aclnnInplaceErfc | Returns the value of the complementary error function corresponding to each element in the input tensor. | Enabled by default | Enabled by default |
| aclnnExp&aclnnInplaceExp | Returns a new tensor where each element is the exponential of the corresponding element in the input. | Enabled by default | Enabled by default |
| aclnnExp2&aclnnInplaceExp2 | Each element of self is used as the power of base 2 for computation. | Enabled by default | Enabled by default |
| aclnnExpand | Broadcasts the input tensor self to a tensor of a specified size. | Enabled by default | Enabled by default |
| aclnnExpm1&aclnnInplaceExpm1 | Calculates the power of the natural constant e using the input self as the exponent, and subtracts 1 from the exponentiation result. | Enabled by default | Enabled by default |
| aclnnExpSegsum | Performs segmentation and computation. Generate a semi-separable matrix with a diagonal of 1 and an upper triangle of 0. | Enabled by default | - |
| aclnnExpSegsumBackward | Performs reverse computation of aclnnExpSegsum. | Enabled by default | - |
| aclnnEye | Returns a two-dimensional tensor. The values of elements on the diagonal of the tensor are 1, and the values of other elements are 0. | Enabled by default | Enabled by default |
| aclnnFlatten | Flattens the input tensor into a 2D tensor based on the given axis. | Enabled by default | Enabled by default |
| aclnnFloor&aclnnInplaceFloor | Returns the result after each element in the input tensor is rounded down and writes back the result to the input tensor. | Enabled by default | Enabled by default |
| aclnnFloorDivide&aclnnInplaceFloorDivide | Performs division and rounds down the remainder. | Enabled by default | Enabled by default |
| aclnnFloorDivides&aclnnInplaceFloorDivides | Performs division and rounds down the remainder. | Enabled by default | Enabled by default |
| aclnnFmodScalar&aclnnInplaceFmodScalar | Returns the remainder of self divided by other. | Enabled by default | Enabled by default |
| aclnnFmodTensor&aclnnInplaceFmodTensor | Returns the remainder of self divided by other. | Enabled by default | Enabled by default |
| aclnnFrac&aclnnInplaceFrac | Calculates the decimal part of each element in the input tensor and then outputs the result. | Enabled by default | Enabled by default |
| aclnnGcd | Computes the element-wise greatest common divisor (GCD) of specified self and other. Both self and other must be integers. | Enabled by default | Enabled by default |
| aclnnGer | Implements outer product of self and vec2. | Enabled by default | Enabled by default |
| aclnnGeScalar&aclnnInplaceGeScalar | Determines whether each element in the input tensor is greater than or equal to the corresponding one of the other scalar and returns a bool tensor that indicates whether the behavior of the greater-than-or-equal-to is true. | Enabled by default | Enabled by default |
| aclnnGeTensor&aclnnInplaceGeTensor | Determines whether each element in the input tensor is greater than or equal to the corresponding one of the other scalar and returns a bool tensor that indicates whether the behavior of the greater-than-or-equal-to is true. | Enabled by default | Enabled by default |
| aclnnGlobalAveragePool | Applies average pooling to values in the same channel for the input tensor X. | Enabled by default | Enabled by default |
| aclnnGlobalMaxPool | Obtains the maximum value in the same channel for the input tensor. | Enabled by default | Enabled by default |
| aclnnGroupedBiasAddGrad | Performs backpropagation of GroupedBiasAdd. | Enabled by default | Enabled by default |
| aclnnGroupedBiasAddGradV2 | Implement the reverse computation of groupBiasAdd. This API is a function extension of the aclnnGroupedBiasAddGrad API. The groupIdxType attribute is added to specify the groupIdx type. | Enabled by default | Enabled by default |
| aclnnGtScalar&aclnnInplaceGtScalar | Determines whether each element in the input tensor is greater than the corresponding one of the other scalar and returns a bool tensor that indicates whether the behavior of the greater-than is true. | Enabled by default | Enabled by default |
| aclnnGtTensor&aclnnInplaceGtTensor | Determines whether the elements in the self tensor are greater than those in the other tensor. Returns a tensor. If self > other, the value is True (1); otherwise, the value is False (0). | Enabled by default | Enabled by default |
| aclnnHansDecode | The compressed tensor is decoded based on PDF, and the restored tensor is reassembled based on mantissa (mantissa). | Enabled by default | Enabled by default |
| aclnnHansEncode | Performs PDF statistics on the byte where the exponent bit of the tensor is located, and performs lossless compression based on the PDF distribution statistics. | Enabled by default | Enabled by default |
| aclnnHardtanh&aclnnInplaceHardtanh | Limits all input elements within the range of [clipValueMin, clipValueMax]. If an element is greater than clipValueMax, the element is limited to clipValueMax. If an element is less than clipValueMin, the element is limited to clipValueMin. Otherwise, the element itself is used. | Enabled by default | Enabled by default |
| aclnnHistc | The elements in tensor self are sorted into equal width bins between min (lower limit) and max (upper limit). If both min and max are equal, the minimum and maximum values of all elements in the tensor are used as the lower and upper limits. Elements lower than min and greater than max are ignored. | Enabled by default | Disabled by default. Can be enabled. |
| aclnnIm2col | Rearranges sliding image neighborhoods into column vectors, and concatenates them into large tensors. The sliding windows are extracted from the batch-processing input tensor. | Enabled by default | Enabled by default |
| aclnnInplaceBitwiseAndScalar | Computes the bitwise AND result of each element in the input tensor and the input scalar other. The input tensor and other must be INT or BOOL variables. When the input is of the Boolean type, the logical AND result is computed. | Enabled by default | Enabled by default |
| aclnnInplaceBitwiseAndTensor | Performs the logical AND operation when the input is a Boolean tensor; performs bitwise AND operation when the input is of the INT type. | Enabled by default | Enabled by default |
| aclnnInplaceCopy | Copies elements in src to the selfRef tensor and returns selfRef. | Enabled by default | Enabled by default |
| aclnnInplaceFillDiagonal | Fills the diagonal of a tensor with fillValue. | Enabled by default | - |
| aclnnInplaceFillScalar | Fills a specified scalar to a tensor. | Enabled by default | Enabled by default |
| aclnnInplaceFillTensor | Fills value to the selfRef tensor. value is a tensor. | Enabled by default | Enabled by default |
| aclnnInplaceMaskedFillScalar | Uses value to fill in the element corresponding to the position whose value istrue in the mask matrix in selfRef. | Enabled by default | Enabled by default |
| aclnnInplaceMaskedFillTensor | Uses value to fill in the element corresponding to the position whose value istrue in the mask matrix in selfRef. | Enabled by default | Enabled by default |
| aclnnInplaceNormal | Uses the normal distributed elements of the mean and std parameters to fill a tensor. Random numbers are extracted from the discrete normal distribution of the given mean and std (standard deviation) to fill the selfRef tensor. mean is a basic FLOAT type, containing the mean of the normal distribution related to each output element. std is a basic FLOAT type, containing the standard deviation of the normal distribution related to each output element. | Enabled by default | Enabled by default |
| aclnnInplaceNormalTensor | Uses the normal distributed elements of the mean and std parameters to fill a tensor. | Enabled by default | Enabled by default |
| aclnnInplaceOne | Returns tensors of the same shape and type. All elements are set to 1. | Enabled by default | Enabled by default |
| aclnnInplaceRandom | Fills the selfRef tensor with the number sampled from the discrete uniform distribution in the range of [from, to-1]. | Enabled by default | Enabled by default |
| aclnnInplaceRandomTensor | Fills the selfRef tensor with the number sampled from the discrete uniform distribution in the range of [from, to-1]. | Enabled by default | Enabled by default |
| aclnnInplaceUniform | Generates random numbers with discrete uniform distribution in the range of [from, to) and fills the random numbers in the selfRef tensor. (The BOOL type of this API has been deprecated. If you need to use it, you are advised to use the aclnnBernoulli or aclnnInplaceBernoulli API.) | Enabled by default | Enabled by default |
| aclnnInplaceUniformTensor | Generates random numbers with discrete uniform distribution in the range of [from, to) and fills the random numbers in the selfRef tensor. | Enabled by default | Enabled by default |
| aclnnInplaceZero | Fills the selfRef tensor with all zeros. | Enabled by default | Enabled by default |
| aclnnIsClose | Returns a new tensor with Boolean elements and determines whether the given values of self and other are close to each other, and returns True if the values are close to each other and returns False otherwise. | Enabled by default | Enabled by default |
| aclnnIsFinite | Determines which elements in a tensor are finite values, that is, not inf, -inf, or nan. | Enabled by default | Enabled by default |
| aclnnIsInf | Determines which elements in a tensor are infinite values, that is, inf and -inf. | Enabled by default | Enabled by default |
| aclnnIsInScalarTensor | Checks whether elements in element are equal to testElement. | Enabled by default | Enabled by default |
| aclnnIsInTensorScalar | Checks whether elements in element are equal to testElement. | Enabled by default | Enabled by default |
| aclnnIsNegInf | Determines whether the elements of the input tensor are negative infinity. | Enabled by default | Enabled by default |
| aclnnIsPosInf | Determines whether the elements of the input tensor are positive infinity. | Enabled by default | Enabled by default |
| aclnnKlDiv | Calculates the KL divergence. | Enabled by default | Enabled by default |
| aclnnLeftShift | Shifts each element in the input tensor self to the left by bit based on the parameter in the corresponding position of the input tensor shiftBits. | Enabled by default | Enabled by default |
| aclnnLeftShifts | Shifts each element in the input tensor self to the left bit by bit based on the input scalar shiftBits. | Enabled by default | Enabled by default |
| aclnnLerp&aclnnInplaceLerp | Performs linear interpolation between the start and end tensors based on the given weight and returns the interpolated tensor. | Enabled by default | Enabled by default |
| aclnnLerps&aclnnInplaceLerps | Performs linear interpolation between the start and end tensors based on the given weight and returns the interpolated tensor. | Enabled by default | Enabled by default |
| aclnnLeScalar&aclnnInplaceLeScalar | Compares each element of self with the corresponding one of other to check if the former is less than or equal to the latter, and writes each comparison result to out. | Enabled by default | Enabled by default |
| aclnnLeTensor&aclnnInplaceLeTensor | Compares each element of self with the corresponding one of other to check if the former is less than or equal to the latter, and writes each comparison result to out. | Enabled by default | Enabled by default |
| aclnnLgamma | Performs the lgamma mathematical operation on each element of the input tensor. | Enabled by default | Enabled by default |
| aclnnLinalgCholesky | Computes the Cholesky factorization of a real symmetric positive definite matrix. | Enabled by default | - |
| aclnnLinalgCross | Performs the linear_cross operation on the input tensor. | Enabled by default | Enabled by default |
| aclnnLinalgQr | Performs orthogonal decomposition on the input tensor. | Enabled by default | Enabled by default |
| aclnnLinspace | Generates a sequence of equally spaced values. | Enabled by default | Enabled by default |
| aclnnLog&aclnnInplaceLog | Computes natural logarithms. | Enabled by default | Enabled by default |
| aclnnLog2&aclnnInplaceLog2 | Computes the logarithm with the base of 2. | Enabled by default | Enabled by default |
| aclnnLog10&aclnnInplaceLog10 | Computes the logarithm of the input with base 10. | Enabled by default | Enabled by default |
| aclnnLog1p&aclnnInplaceLog1p | Computes log1p for the input tensor. | Enabled by default | Enabled by default |
| aclnnLogAddExp | Computes the logarithm (base: e) of the power sum of the input tensor. | Enabled by default | Enabled by default |
| aclnnLogAddExp2 | Computes the logarithm (base: 2) of the power sum of the input tensor. | Enabled by default | Enabled by default |
| aclnnLogdet | Calculates the natural logarithm of the determinant of the input self. | Enabled by default | Enabled by default |
| aclnnLogicalAnd&aclnnInplaceLogicalAnd | Computes the element-wise logical AND operation of a given input tensor. The value 0 is considered as False, and other values are considered as True. | Enabled by default | Enabled by default |
| aclnnLogicalNot&aclnnInplaceLogicalNot | Computes the element-wise logical NOT of the given input tensor. If no output type is specified, the output tensor is of the Boolean type. | Enabled by default | Enabled by default |
| aclnnLogicalOr&aclnnInplaceLogicalOr | Computes the element-wise logical OR operation of a given input tensor. When the two input tensors are of the non-Boolean type, 0 is considered as False and a non-zero value is considered as True. | Enabled by default | Enabled by default |
| aclnnLogicalXor | Completes the logical XOR operation of a given input tensor element. When self and other are of the non-Boolean type, 0 is considered as False and a non-zero value is considered as True. | Enabled by default | Enabled by default |
| aclnnLogSpace | Creates a one-dimensional tensor of size , whose value is evenly spaced on the logarithmic scale from to , including endpoints, with as the base. | Enabled by default | Enabled by default |
| aclnnLogSumExp | Returns the log of summed exponents of the input tensor in a given dimension. | Enabled by default | Enabled by default |
| aclnnLtScalar&aclnnInplaceLtScalar | Compares each element of self with the corresponding one of other to check if the former is less than the latter, and returns a tensor of the Boolean type. | Enabled by default | Enabled by default |
| aclnnLtTensor&aclnnInplaceLtTensor | Compares each element of self with the corresponding one of other to check if the former is less than the latter, and returns a tensor of the Bool type. | Enabled by default | Enabled by default |
| aclnnMaskedScale | Performs element-wise computation. | Enabled by default | Enabled by default |
| aclnnMaskedSelect | Selects elements in the input tensor (self) as the output according to the Boolean mask tensor (mask) and returns a new one-dimensional tensor. | Enabled by default | Enabled by default |
| aclnnMax | Returns the maximum value of all elements in the tensor. | Enabled by default | Enabled by default |
| aclnnMaxDim | Returns the maximum value of the specified dimension of a tensor and the index position of the value. | Enabled by default | Enabled by default |
| aclnnMaximum | Computes the element-wise maximum value of two tensors and returns a new tensor. | Enabled by default | Enabled by default |
| aclnnMaxN | Computes the maximum value of each element in the input tensor list. | Enabled by default | Enabled by default |
| aclnnMaxV2 | Computes the maximum element value of an input tensor on a specified dimension. | Enabled by default | Enabled by default |
| aclnnMean | Computes the mean value of tensors on a specified dimension. | Enabled by default | Enabled by default |
| aclnnMeanV2 | Computes the mean value of tensors on a specified dimension. | Enabled by default | Enabled by default |
| aclnnMin | Returns the minimum value of all elements in a tensor. | Enabled by default | Enabled by default |
| aclnnMinDim | Returns the minimum value and index position of the specified dimension in self. | Enabled by default | Enabled by default |
| aclnnMinimum | Computes the element-wise minimum value of two tensors and returns a new tensor. | Enabled by default | Enabled by default |
| aclnnMinN | Computes the minimum value of each element in the input tensor list. | Enabled by default | Enabled by default |
| aclnnMul&aclnnInplaceMul | Performs multiplication computation between tensors. | Enabled by default | Enabled by default |
| aclnnMuls&aclnnInplaceMuls | Performs multiplication computation between the tensor and scalar. | Enabled by default | Enabled by default |
| aclnnMultinomial | In the input tensor, numsamples samples are extracted based on the distribution probability of each object, and the indexes of these samples are stored in the output tensor. | Enabled by default | Enabled by default |
| aclnnMultinomialTensor | In the input tensor, numsamples samples are extracted based on the distribution probability of each object, and the indexes of these samples are stored in the output tensor. | Enabled by default | Enabled by default |
| aclnnNanToNum&aclnnInplaceNanToNum | Replaces NaN, positive infinity, and negative infinity in the input with the values specified by nan, posinf, and neginf, respectively. | Enabled by default | Enabled by default |
| aclnnNeg&aclnnInplaceNeg | Computes the opposite number of each input element. | Enabled by default | Enabled by default |
| aclnnNeScalar&aclnnInplaceNeScalar | Computes whether the element values in selfRef are equal to those in other. | Enabled by default | Enabled by default |
| aclnnNeTensor&aclnnInplaceNeTensor | Computes whether the element values in self (selfRef) are equal to those in other. | Enabled by default | Enabled by default |
| aclnnNormalFloatFloat | Returns a random number tensor obtained from the independent normal distribution of the given mean (float) and standard deviation (float). | - | Enabled by default |
| aclnnNormalFloatTensor | Returns a random number tensor obtained from the independent normal distribution of the given mean (float) and standard deviation (tensor). | Enabled by default | Enabled by default |
| aclnnNormalTensorFloat | Returns a random number tensor obtained from the independent normal distribution of the given mean (tensor) and standard deviation (float). | Enabled by default | Enabled by default |
| aclnnNormalTensorTensor | Returns a random number obtained from the independent normal distribution of the given mean (tensor) and standard deviation (tensor). | Enabled by default | Enabled by default |
| aclnnNpuFormatCast | Performs ND ←→ [NZ] conversion. | Enabled by default | Enabled by default |
| aclnnOneHot | Performs one_hot computation on an input self whose length is n to obtain an output out whose number of elements is n x k. | Enabled by default | Enabled by default |
| aclnnPdist | Computes the p-norm distance of each pair of row vectors in the input self. | Enabled by default | - |
| aclnnPdistForward | Computes the p-norm distance of each pair of row vectors in the input self. | Enabled by default | - |
| aclnnPermute | Exchanges any dimension of a tensor. For example, if the input self is a tensor with shape [2, 3, 5] and dims is (2, 0, 1), the output is a tensor with shape [5, 2, 3]. | Enabled by default | Enabled by default |
| aclnnPolar | Calculate the Cartesian coordinates corresponding to the absolute value of the input and the polar coordinates corresponding to the angle to obtain a complex tensor out. | Enabled by default | Enabled by default |
| aclnnPowScalarTensor | Uses each element of exponent as the power of the corresponding element of input to complete the computation. | Enabled by default | Enabled by default |
| aclnnPowTensorScalar&aclnnInplacePowTensorScalar | Uses each element of exponent as the power of the corresponding element of input to complete the computation. | Enabled by default | Enabled by default |
| aclnnPowTensorTensor&aclnnInplacePowTensorTensor | Uses each element of exponent as the power of the corresponding element of input to complete the computation. | Enabled by default | Enabled by default |
| aclnnPrecisionCompare | Checks whether two tensor elements are the same, compares the accuracy, and returns the operator execution status code. No management plane fault is reported. | Enabled by default | Enabled by default |
| aclnnProd | Returns the product of all elements in the input tensor. | Enabled by default | Enabled by default |
| aclnnProdDim | Returns the product of each row in a specified dimension of the input tensor. | Enabled by default | Enabled by default |
| aclnnQr | Performs orthogonal decomposition on the input tensor. | Enabled by default | - |
| aclnnInplaceRandomWithoutFromTo | Given seed/offset (int64), integers are sampled from the discrete uniform distribution of [0, DTYPE_MAX_VALUE] to fill the selfRef tensor by default. | - | Enabled by default |
| aclnnInplaceRandomWithoutFromToTensor | Given seed/offset (tensor), integers are sampled from the discrete uniform distribution of [0, DTYPE_MAX_VALUE] to fill the selfRef tensor by default. | - | Enabled by default |
| aclnnRandperm | Returns a random integer ranging from 0 to n-1. | Enabled by default | Enabled by default |
| aclnnRange | The value is obtained from start to end based on the step. | Enabled by default | Enabled by default |
| aclnnReal | Obtains the real number part of each element of the input tensor. | Enabled by default | Enabled by default |
| aclnnReciprocal&aclnnInplaceReciprocal | Returns a new tensor with the reciprocal of each input element. | Enabled by default | Enabled by default |
| aclnnReduceLogSum | Computes the log sum of the input tensor's elements along the provided axes. | Enabled by default | - |
| aclnnReduceNansum | Returns the sum of a specified dimension of the input tensor after NaN in the tensor is processed to 0. | Enabled by default | - |
| aclnnReduceSum | Returns the sum of each row in a specified dimension of the input tensor. | Enabled by default | Enabled by default |
| aclnnReflectionPad1d | Pads the input tensor with the reflection of the input boundary. | Enabled by default | Enabled by default |
| aclnnReflectionPad1dBackward | Performs backpropagation of reflection_pad1d. For details about the forward propagation, see aclnnReflectionPad1d. | Enabled by default | Enabled by default |
| aclnnReflectionPad2d | Pads the input tensor with the reflection of the input boundary. | Enabled by default | Enabled by default |
| aclnnReflectionPad2dBackward | Performs backpropagation of reflection_pad2d. For details about the forward propagation, see aclnnReflectionPad2d. | Enabled by default | Enabled by default |
| aclnnReflectionPad3d | Performs 3D reflection padding. | Enabled by default | Enabled by default |
| aclnnReflectionPad3dBackward | Performs backpropagation of aclnnReflectionPad3d. | Enabled by default | Enabled by default |
| aclnnRemainderScalarTensor | After the scalar self is broadcast into a tensor with the same shape as the tensor other, converts each element in the tensor to the remainder obtained by dividing the corresponding element of the tensor other. | Enabled by default | Enabled by default |
| aclnnRemainderTensorScalar&aclnnInplaceRemainderTensorScalar | Returns the remainder of each element in tensor self divided by scalar other. | Enabled by default | Enabled by default |
| aclnnRemainderTensorTensor&aclnnInplaceRemainderTensorTensor | After the tensors self and other are broadcast to the same shape, each element is converted to the remainder obtained after the element is divided by the corresponding element of other. | Enabled by default | Enabled by default |
| aclnnRepeat | Repeats the input tensor for the number of times specified by repeats along each dimension. | Enabled by default | Enabled by default |
| aclnnReplicationPad1d | Pads the last dimension of the input tensor using replication of the input boundary. | Enabled by default | Enabled by default |
| aclnnReplicationPad1dBackward | Performs backpropagation of replication_pad1d. | Enabled by default | Enabled by default |
| aclnnReplicationPad2d | Pads the last two dimensions of the input tensor using replication of the input boundary. | Enabled by default | Enabled by default |
| aclnnReplicationPad2dBackward | Performs backpropagation of replication_pad2d. For details about the forward propagation, see aclnnReplicationPad2d. | Enabled by default | Enabled by default |
| aclnnReplicationPad3d | Pads the last three dimensions of the input tensor using replication of the input boundary. | Enabled by default | Enabled by default |
| aclnnReplicationPad3dBackward | Performs backpropagation of aclnnReplicationPad3d. | Enabled by default | Enabled by default |
| aclnnRightShift | Shifts each element in the input tensor to the right by bit based on the corresponding parameter in the input tensor shiftBits. | Enabled by default | Enabled by default |
| aclnnRoll | Rolls data in a tensor based on the given size and dimension. | Enabled by default | Enabled by default |
| aclnnRound&aclnnInplaceRound | Rounds the input value to the nearest integer. If the value is equidistant from two integers, round it to the even integer. | Enabled by default | Enabled by default |
| aclnnRoundDecimals&aclnnInplaceRoundDecimals | Rounds the elements of the input tensor to the specified number of decimal places. | Enabled by default | Enabled by default |
| aclnnRsqrt&aclnnInplaceRsqrt | Computes the reciprocal of the square root of each element in the input tensor. | Enabled by default | Enabled by default |
| aclnnRsub | Performs subtraction. | Enabled by default | Enabled by default |
| aclnnRsubs | Performs subtraction. | Enabled by default | Enabled by default |
| aclnnScale | Computes the scale and bias of the input tensor. If bias is not specified, is used. If bias is specified, is used. | Enabled by default | Enabled by default |
| aclnnSearchSorted | Searches for the position where a given tensor value (self) should be inserted in a sorted tensor (sortedSequence). | Enabled by default | Enabled by default |
| aclnnSearchSorteds | Searches for the position where a given scalar value (self) should be inserted in a sorted one-dimensional tensor (sortedSequence). | Enabled by default | - |
| aclnnSign | Performs the sign function on each element of the input tensor and outputs the result tensor. | Enabled by default | Enabled by default |
| aclnnSignbit | Checks whether the sign bit of each element in the input is 1 and returns a tensor. | Enabled by default | Enabled by default |
| aclnnSignBitsPack | Packs one bit of Adam of the float16 or float32 type into uint8. | Enabled by default | - |
| aclnnSignBitsUnpack | Unpacks 1-bit Adam of the uint8 type into float32 or float16. | Enabled by default | - |
| aclnnSilentCheck | The SilentCheckV2 operator compares the input feature value (val) with the absolute threshold and relative threshold to determine whether to trigger a silence check fault. | Enabled by default | - |
| aclnnSilentCheckV2 | Whether to trigger a silence detection fault is identified based on the stepRef parameter and the Markov inequality threshold. | Enabled by default | - |
| aclnnSimThreadExponential | Generates an exponentially distributed random number that obeys the lambda parameter and fills it in the selfRef tensor. | Enabled by default | Enabled by default |
| aclnnSin&aclnnInplaceSin | Performs the sin operation on the input tensor. | Enabled by default | Enabled by default |
| aclnnSinc&aclnnInplaceSinc | Performs the sinc operation on the input tensor. | Enabled by default | Enabled by default |
| aclnnSinh&aclnnInplaceSinh | Performs the sinh operation on the input tensor. | Enabled by default | Enabled by default |
| aclnnSinkhorn | Computes the Sinkhorn distance, which can be used for expert routing in MoE models. | Enabled by default | - |
| aclnnSlice | Extracts the sub-tensor out from the input tensor self based on the given range [start, end] and step in the specified dimension dim. | Enabled by default | Enabled by default |
| aclnnSliceV2 | Extracts the tensor out from the input tensor self based on the specified dimension axes, range [starts, ends], and step steps. | Enabled by default | Enabled by default |
| aclnnSlogdet | Calculates the sign and natural logarithm of the determinant of the input self. | Enabled by default | Enabled by default |
| aclnnSort | Sorts elements in the input tensor in ascending or descending order along a specified dimension and returns the corresponding index value. | Enabled by default | Enabled by default |
| aclnnSplitTensor | Splits the input self along the dim axis into equally-sized sections based on the splitSections size. | Enabled by default | Enabled by default |
| aclnnSplitWithSize | Splits the input self along the dim axis into the size of each element in splitSize. | Enabled by default | Enabled by default |
| aclnnSqrt&aclnnInplaceSqrt | Calculates the square root of a non-negative number. For a negative number, nan is returned. | Enabled by default | Enabled by default |
| aclnnSquare | Computes the square value of each element in the input tensor. | Enabled by default | Enabled by default |
| aclnnStack | Stacks tensors along a new axis. | Enabled by default | Enabled by default |
| aclnnStd | Computes the standard deviation of a specified dimension (dim), which can be a single dimension, a dimension list, or None. | Enabled by default | Enabled by default |
| aclnnStdMeanCorrection | Computes the standard deviation and mean of the sample. | Enabled by default | Enabled by default |
| aclnnStridedSlice | Extracts a sub tensor from the input tensor based on the specified start position, end position, and step. | - | Enabled by default |
| aclnnStridedSliceAssignV2 | StridedSliceAssign assigns a value to the tensor slice. It can assign the content of tensor inputValue to a specified position in the target tensor varRef. | Enabled by default | - |
| aclnnStridedSliceGrad | Reverse operator of StridedSlice. It maps the slice gradient tensor dy back to the corresponding position of the original tensor shape. The position that is not covered by the slice is filled with zeros. | - | Enabled by default |
| aclnnSub&aclnnInplaceSub | The subtraction computation is complete, and the subtracted number is scaled by alpha. | Enabled by default | Enabled by default |
| aclnnSubs&aclnnInplaceSubs | The subtraction computation is complete, and the subtracted number is scaled by alpha. | Enabled by default | Enabled by default |
| aclnnSum | Returns the sum of each input tensor in the input tensors list. | Enabled by default | - |
| aclnnSvd | Computes singular value decomposition of one or more matrices. | Enabled by default | Enabled by default |
| aclnnSWhere | Selects elements from self or other based on the condition and returns the elements (broadcasting is supported). | Enabled by default | Enabled by default |
| aclnnTan&aclnnInplaceTan | Computes the tangent of each element in the input tensor self and stores the result in the output tensor out. | Enabled by default | Enabled by default |
| aclnnTanh&aclnnInplaceTanh | Activation function Returns a tensor with the same shape as the input tensor. Performs elementwise computation on the input tensor. | Enabled by default | Enabled by default |
| aclnnTanhBackward | Performs backpropagation of aclnnTanh. | Enabled by default | Enabled by default |
| aclnnTopk | Returns the k extremum values and indexes of the input tensor in the specified dimension. | Enabled by default | Enabled by default |
| aclnnTrace | Calculates the sum of the main diagonal elements of a matrix starting from the upper left corner. | Enabled by default | - |
| aclnnTransformBiasRescaleQkv | The TransformBiasRescaleQkv operator is an API used to process the query, key, and value vectors in the multi-head attention mechanism. | Enabled by default | Enabled by default |
| aclnnTransConvolutionWeight | Creates a weight tensor for computation performance affinity of the Convolution operator. This API must be used in conjunction with aclnnCalculateConvolutionWeightSize. | Enabled by default | - |
| aclnnTransMatmulWeight | Creates a weight tensor for computation performance affinity of the Matmul operator. This API must be used in conjunction with aclnnCalculateMatmulWeightSize and aclnnCalculateMatmulWeightSizeV2. | Enabled by default | Enabled by default |
| aclnnTriangularSolve | Solves a system of equations with a square upper or lower triangular invertible matrix A and multiple right-hand sides b. | Enabled by default | Enabled by default |
| aclnnTril&aclnnInplaceTril | Zeros the upper right part of the last two dimensions (counted from left to right by shape) of the input self tensor along the diagonal. | Enabled by default | Enabled by default |
| aclnnTriu&aclnnInplaceTriu | Zeros the lower left part of the last two dimensions (counted from left to right by shape) of the input self tensor along the diagonal. | Enabled by default | Enabled by default |
| aclnnTrunc&aclnnInplaceTrunc | Performs the truncation operation on the input tensor, that is, truncates the decimal part of a number and returns the integer part. | Enabled by default | Enabled by default |
| aclnnUnfoldGrad | Performs backpropagation of the Unfold operator and computes its gradient. | Enabled by default | Enabled by default |
| aclnnVar | Returns the variance over the value of the specified dimension of the input tensor. | Enabled by default | Enabled by default |
| aclnnVarCorrection | Returns the variance over the value of the specified dimension of the input tensor. | Enabled by default | Enabled by default |
| aclnnVarMean | Returns the mean and variance of the dimension specified by the input tensor. | Enabled by default | Enabled by default |
| aclnnWeightQuantPreprocess | Preprocess the parameters of the fake-quantization Matmul. | - | Enabled by default |
| aclnnXlog1py | Calculates x * log(1 + y). If x = = 0, the result is 0. Broadcast is supported. | Enabled by default | Enabled by default |
| aclnnAmpUpdateScale | Implements the dynamic scale update logic in AMP training. | Enabled by default | Enabled by default |
| aclnnXLogYScalarOther&aclnnInplaceXLogYScalarOther | Computes the result of self * log(other). | Enabled by default | - |
| aclnnXLogYScalarSelf | Computes the result of self * log(other). | Enabled by default | - |
| aclnnXLogYTensor&aclnnInplaceXLogYTensor | Computes the result of self * log(other). | Enabled by default | - |
| aclRfft1D | Performs Real Fast Fourier Transform (RFFT) on the input tensor self, and outputs a complex tensor containing non-negative frequencies. | Enabled by default | - |
| aclStft | Computes the Fourier transform of the input in a sliding window. | Enabled by default | Enabled by default |