Operator APIs (aclnn)
Instructions
To facilitate operator calling, a set of C-based APIs (prefixed with aclnn) is provided, eliminating the need for IR (Intermediate Representation) definitions and enabling efficient model building and app development. This approach is referred to as "single-operator API call", abbreviated as aclnn call.
When calling an operator API, you need to reference the dependent header files and library files. Generally, header files are located in ${INSTALL_DIR}/include/aclnnop by default, and library files are located in ${INSTALL_DIR}/lib64 by default. The specific files are as follows:
Header files: ① Method 1 (recommended): Reference the operator repository master header file aclnn_ops_${ops_project}.h. ② Method 2: Reference the single-operator API header file aclnn_*.h.
Library file: Reference the library file libopapi_${ops_project}.so corresponding to the operator repository. Note that the original master library file libopapi.so for all operator repositories will be deprecated in the future. It is not recommended for use, nor is it supported for simultaneous use with individual operator repository files.
Here, ${INSTALL_DIR} indicates the CANN installation directory, and ${ops_project} indicates the operator repository name (such as math, nn, cv, transformer). Set it to the actual operator repository name.
API List
Determinism Overview:
- Configuration: Due to factors such as different CANN or NPU models, it may not be possible to guarantee consistent results across multiple runs of the same operator. Under the same conditions (platform, device, version, and other randomness parameters), some operator APIs can enable deterministic algorithms through
aclrtCtxSetSysParamOpt(see acl API (C)) to ensure consistent results across multiple runs.- Performance: Deterministic computation for the same operator is typically slower than non-deterministic computation, which may degrade the single-run performance of the model. However, in scenarios such as experimentation, debugging, and troubleshooting where consistent results across multiple runs are required to locate issues, deterministic computation can improve efficiency.
- Threading: The deterministic state can be set only once per thread. If set multiple times, only the last valid setting takes effect. A valid setting means that after the deterministic state is set, an operator task dispatch is actually executed. If only the setting is performed without any operator dispatch, the deterministic variable is enabled but not dispatched to the operator, so the operator is not executed. Solution: Setting determinism multiple times within a single thread is not recommended at this time. This issue exists in both binary enabled and disabled scenarios and will be resolved in a future version.
- Symbol Description: A " - " symbol in the table indicates that the API does not currently support the product listed in that column.
The operator API list is as follows:
| Interface Name | Description | Deterministic Implementation (A2/A3) | Deterministic Implementation (Ascend 950) |
|---|---|---|---|
| aclnnAbs | Computes the absolute value of a tensor. | Default | Default |
| aclnnAcos&aclnnInplaceAcos | Performs the arccosine operation on each element of the input matrix and outputs the result. | Default | - |
| aclnnAcosh&aclnnInplaceAcosh | Performs the inverse hyperbolic cosine operation on each element of the input tensor and outputs the result. | Default | - |
| aclnnAngleV2 | Computes the angle (in radians) for each element of the input tensor. | Default | - |
| aclnnAdd&aclnnInplaceAdd | Performs addition. | Default | Default |
| aclnnAddcdiv&aclnnInplaceAddcdiv | Performs addition. | Default | Default |
| aclnnAddcmul&aclnnInplaceAddcmul | Performs element-wise multiplication of tensor1 and tensor2, multiplies the result by the scalar value, and performs element-wise addition with the input self/selfRef. | Default | Default |
| aclnnAddLora | Adds a LoRA (Low-Rank Adaptation) layer to a neural network, reducing the number of parameters through low-rank decomposition. | Default | - |
| aclnnAddr&aclnnInplaceAddr | Computes the outer product of two 1D vectors vec1 and vec2 to obtain a 2D matrix, multiplies the outer product result by a coefficient, adds it to the self multiplied by a coefficient, and outputs the result. | Default | Default |
| aclnnAdds | Performs addition. | Default | Default |
| aclnnAddV3&aclnnInplaceAddV3 | Performs addition. | Default | Default |
| aclnnAffineGrid | Generates a 2D or 3D grid given a set of 3D affine parameter matrices (theta) and the output image size, where the grid represents the coordinates of points in the original image after affine transformation. | Default | - |
| aclnnAll | For each dimension in the given dimension dim, returns True if all elements corresponding to that dimension in the input tensor evaluate to True, otherwise returns False. | Default | Default |
| aclnnAmax | Returns the maximum value of each slice of the tensor along the specified dimension (dim). | Default | Default |
| aclnnAmin | Returns the minimum value of each slice of the tensor along the specified dimension (dim). | Default | Default |
| aclnnAminmax | Returns the minimum and maximum values of each row of the input tensor along the specified dimension. | Default | Default |
| aclnnAminmaxAll | Returns the minimum and maximum values of the input tensor across all dimensions. | Default | Default |
| aclnnAminmaxDim | Returns the minimum and maximum values of the input tensor along the specified dimension. | Default | Default |
| aclnnAny | For each dimension in the given dimension dim, returns True if any element corresponding to that dimension in the input tensor evaluates to True, otherwise returns False. | Default | Default |
| aclnnArange | Obtains values from start to end at intervals of step and stores them in the output 1D tensor, where the data range is [start, end). | Default | Default |
| aclnnArgMax | Returns the index of the maximum value of the tensor along the specified dimension (dim) and stores it in the out tensor. | Default | Default |
| aclnnArgMin | Returns the index of the minimum value of the tensor along the specified axis and stores it in out. | Default | Default |
| aclnnArgsort | Sorts the elements of the input tensor in ascending or descending order along a specified dimension and returns the corresponding index values. | Default | Default |
| aclnnAsin&aclnnInplaceAsin | Performs the arcsine operation on each element of the input matrix and outputs the result. | Default | - |
| aclnnAsinh&aclnnInplaceAsinh | Performs the inverse hyperbolic sine operation on each element of the input tensor and outputs the result. | Default | - |
| aclnnAtan&aclnnInplaceAtan | Performs the arctangent operation on each element of the input matrix and outputs the result. | Default | Default |
| aclnnAtan2&aclnnInplaceAtan2 | Performs element-wise arctangent operation on the input tensors self and other. | Default | |
| aclnnAtanh&aclnnInplaceAtanh | Performs the inverse hyperbolic tangent operation on each element of the input tensor and outputs the result. | Default | - |
| aclnnBatchNormStats | Computes the mean and the reciprocal of the standard deviation of the single-device input data. | Default | Default |
| aclnnBernoulli&aclnnInplaceBernoulli | Draws binary random numbers (0 or 1) from a Bernoulli distribution, where prob is the probability of generating a binary random number and the input tensor specifies the shape. | Default | Default |
| aclnnBernoulliTensor&aclnnInplaceBernoulliTensor | Draws binary random numbers (0 or 1) from a Bernoulli distribution, where prob is the probability of generating a binary random number and the input tensor specifies the shape. | Default | Default |
| aclnnBincount | Counts the frequency of each number in a non-negative integer array. | Default | Non-deterministic by default; allowed to enable |
| aclnnBitwiseNot | Performs a logical NOT operation when the input is a BOOL tensor; performs a bitwise NOT operation when the input is an INT tensor. | Default | Default |
| aclnnBitwiseAndScalar | Computes the bitwise AND result of each element in the input tensor and the input scalar. | Default | Default |
| aclnnBitwiseAndTensor | Performs a logical AND operation when the input is a BOOL tensor; performs a bitwise AND operation when the input is an INT tensor. | Default | Default |
| aclnnBitwiseAndTensorOut&aclnnInplaceBitwiseAndTensorOut | Performs a logical AND operation when the input is a BOOL tensor; performs a bitwise AND operation when the input is an INT tensor. | Default | Default |
| aclnnBitwiseOrScalar&aclnnInplaceBitwiseOrScalar | Computes the bitwise OR of each element in the input tensor self and the input scalar other. | Default | Default |
| aclnnBitwiseOrTensor&aclnnInplaceBitwiseOrTensor | Computes the bitwise OR of each element in the tensor self and the element at the corresponding position in the other tensor. | Default | Default |
| aclnnBitwiseXorScalar&aclnnInplaceBitwiseXorScalar | Computes the bitwise XOR of each element in the input tensor self and the input scalar other. The inputs self and other must be of integer or boolean type. For boolean type, computes the logical XOR. | Default | Default |
| aclnnBitwiseXorTensor&aclnnInplaceBitwiseXorTensor | Computes the bitwise XOR of each element in the input tensor self and the element at the corresponding position in the input tensor other. The inputs self and other must be of integer or boolean type. For boolean type, computes the logical XOR. | Default | Default |
| aclnnCalculateConvolutionWeightSize | Calculates the size of the weight to be allocated for the Convolution operator with NCHW format input. Only the Float16 data type is supported. This API is used only to determine how much size is needed for preprocessing the weight tensor to achieve optimal Convolution operator performance. | Default | - |
| aclnnCalculateMatmulWeightSize | Calculates the size of the weight to be allocated for the Matmul operator with ND format input. This API is used only to determine how much size is needed for preprocessing the weight tensor to achieve optimal Matmul operator performance. | Default | |
| aclnnCalculateMatmulWeightSizeV2 | Calculates the space (in number of elements) required to convert the weight from ND format to NZ format for the Matmul operator. This API is used only to determine how much size is needed for preprocessing the weight tensor to achieve optimal Matmul operator performance. | Default | Default |
| aclnnCast | Converts the data type of a tensor. | Default | Default |
| aclnnCat | Concatenates all tensors in tensors along the dimension dim. | Default | Default |
| aclnnCdist | Computes the p-norm distance between each pair of points in two sets of vectors. | Default | - |
| aclnnCdistBackward | Performs the backward propagation of aclnnCdist. | Default | - |
| aclnnCeil&aclnnInplaceCeil | Returns the result of rounding up each element in the input tensor. | Default | Default |
| aclnnChannelShuffle | Divides the channels of a (*, C, H, W) tensor into g groups, randomly shuffles the channels within each group, and then merges all channels for output, while keeping the shape of the final output tensor consistent with the input tensor. | Default | Default |
| aclnnChunkCat | Splits all tensors in tensors into numChunks chunks along the dimension dim, then concatenates them along the dimension after dim, and finally converts the result to the data type of out. | Default | - |
| aclnnCircularPad2d | Pads the last two dimensions of the input tensor using circular padding. | Default | Default |
| aclnnCircularPad3d | Pads the last three dimensions of the input tensor using circular padding. | Default | Default |
| aclnnCircularPad2dBackward | Performs backward propagation of circular_pad2d. For the forward computation, see aclnnCircularPad2d. | Default | Default |
| aclnnCircularPad3dBackward | Performs backward propagation of aclnnCircularPad3d. | Default | Default |
| aclnnClamp | Clamps all elements of the input to the range [min, max]. If min is None, there is no lower bound. If max is None, there is no upper bound. | Default | Default |
| aclnnClampMax&aclnnInplaceClampMax | Clamps all elements of the input to the range [-inf, max]. | Default | Default |
| aclnnClampMaxTensor&aclnnInplaceClampMaxTensor | Clamps all elements of the input to the range [-inf, max]. | Default | Default |
| aclnnClampMin | Clamps all elements of the input to the range [min, inf]. | Default | Default |
| aclnnClampMinTensor&aclnnInplaceClampMinTensor | Clamps all elements of the input to the range [min, inf]. | Default | Default |
| aclnnCoalesceSparse | Accumulates and sums the values at the same coordinate points to reduce the memory size of the Coo_Tensor. | Non-deterministic by default; not allowed to enable | - |
| aclnnClampTensor | Clamps all elements of the input to the range [min, max]. If min is omitted, there is no lower bound. If max is omitted, there is no upper bound. | Default | Default |
| aclnnComplex | Takes two tensors real and imag with the same shape and dtype as input. | Default | - |
| aclnnConfusionTranspose | Fuses reshape and transpose operations. | Default | Default |
| aclnnConstantPadNd | Pads the input tensor self based on the pad parameter, with the padding value set to value. | Default | Default |
| aclnnCos&aclnnInplaceCos | Performs the cosine operation on each element of the input matrix and outputs the result. | Default | Default |
| aclnnCosh&aclnnInplaceCosh | A hyperbolic function that returns a new tensor according to the formula. The shape of the result is the same as the input tensor. | Default | Default |
| aclnnCummax | Computes the cumulative maximum of self and returns the maximum values along with the corresponding indices. | Default | - |
| aclnnCummin | Computes the cumulative minimum of self and returns the minimum values along with the corresponding indices. | Default | |
| aclnnCumprod&aclnnInplaceCumprod | Adds the aclnnCumprod API. The cumprod function computes the cumulative product of the input tensor along the specified dimension. | Default | - |
| aclnnCumsum | Performs cumulative summation on the elements of the input tensor self along the specified dimension dim and stores the result in the output tensor out. | Default | Default |
| aclnnCumsumV2 | Performs cumulative summation on the elements of the input tensor self along the specified dimension dim and stores the result in the output tensor out. | Default | Default |
| aclnnDiag | If the input is a vector (1D tensor), returns a 2D matrix tensor with the input elements on the diagonal. If the input is a 2D tensor, returns a 1D vector whose values are the diagonal elements of the input matrix specified by diagonal. | Default | Default |
| aclnnDiagFlat | Generates a diagonal tensor. If the input self is a 1D tensor, returns a 2D tensor with the elements of self as the diagonal values. If the input self is a 2D or higher-dimensional tensor, it is first flattened (reduced to a 1D tensor) and then processed as in the first case. | Default | Default |
| aclnnDigamma | Performs the digamma mathematical operation on each element of the input tensor. | Default | - |
| aclnnDiv&aclnnInplaceDiv | Performs division. | Default | Default |
| aclnnDivMod&aclnnInplaceDivMod | Performs division and selects the rounding operation based on the mode parameter. | Default | Default |
| aclnnDivMods&aclnnInplaceDivMods | Performs division and selects the rounding operation based on the mode parameter. | Default | Default |
| aclnnDivs&aclnnInplaceDivs | Performs division. | Default | Default |
| aclnnDot | Computes the dot product of two 1D tensors. | Default | Default |
| aclnnDropout | During training, randomly zeros elements of the input with probability p and scales the output by a factor of 1/(1-p). | Default | - |
| aclnnDropoutBackward | During training, zeros elements of the input based on the corresponding bit values in mask and scales or zeros them according to scale. If the corresponding bit in mask is 1, the corresponding element in gradOutput is scaled up. If the bit in mask is 0, the corresponding element in gradOutput is set to zero. Specifically, if scale is 0, all elements are set to 0. If scale is 1, the elements of gradOutput remain unchanged. It is recommended to use this API in combination with aclnnDropoutGenMask or aclnnDropoutGenMaskV2. | Default | Default |
| aclnnDropoutDoMask | Randomly zeros elements of the input with probability prob and scales the output by a factor of 1/(1-prob). | Default | Default |
| aclnnDropoutGenMask | During training, generates a mask with probability prob for zeroing elements. | Default | Default |
| aclnnDropoutGenMaskV2 | During training, generates a mask with probability prob for zeroing elements. | Default | Default |
| aclnnDropoutGenMaskV2Tensor | During training, generates a mask with probability prob for zeroing elements. | Default | Default |
| aclnnDropoutV3 | Randomly zeros elements of the input with probability p and scales the output by a factor of 1/(1-p). | Default | Default |
| aclnnEqScalar&aclnnInplaceEqScalar | Compares whether the value of each element in self is equal to the value of other, and writes the comparison result of each element in self with the value of other into out. | Default | Default |
| aclnnEqTensor&aclnnInplaceEqTensor | Compares whether the elements in two tensors are equal and returns a tensor, where self == other yields True (1.) and otherwise yields False (0.). | Default | Default |
| aclnnEqual | Checks whether two tensors have the same size and elements and returns a Bool value. | Default | Default |
| aclnnErf&aclnnInplaceErf | Returns the value of the error function for each element in the input tensor. | Default | Default |
| aclnnErfc&aclnnInplaceErfc | Returns the value of the complementary error function for each element in the input tensor. | Default | - |
| aclnnExp&aclnnInplaceExp | Returns a new tensor where each element is the exponential of the corresponding element in the input tensor. | Default | Default |
| aclnnExpand | Broadcasts the input tensor self to a tensor of the specified size. | Default | Default |
| aclnnExpm1&aclnnInplaceExpm1 | Computes the power of the natural constant e with self as the exponent, and subtracts 1 from the exponential result. | Default | Default |
| aclnnExp2&aclnnInplaceExp2 | Computes the power of base 2 for each element in self. | Default | Default |
| aclnnExpSegsum | Performs segmented sum computation. Generates a semi-separable matrix with zeros on the diagonal and -inf in the upper triangle. | Default | - |
| aclnnExpSegsumBackward | Performs the backward computation of aclnnExpSegsum. | Default | - |
| aclnnEye | Returns a 2D tensor with ones on the diagonal and zeros elsewhere. | Default | Default |
| aclnnFlatten | Flattens the input tensor into a 2D tensor based on the given axis. | Default | Default |
| aclnnFloor&aclnnInplaceFloor | Rounds down each element in the input tensor and writes the result back into the input tensor. | Default | Default |
| aclnnFloorDivide&aclnnInplaceFloorDivide | Performs division and rounds the remainder down. | Default | Default |
| aclnnFloorDivides&aclnnInplaceFloorDivides | Performs division and rounds the remainder down. | Default | Default |
| aclnnFmodScalar&aclnnInplaceFmodScalar | Returns the remainder of self divided by other. | Default | Default |
| aclnnFmodTensor&aclnnInplaceFmodTensor | Returns the remainder of self divided by other. | Default | Default |
| aclnnFrac&aclnnInplaceFrac | Computes the fractional part of each element in the input tensor and outputs the result. | Default | |
| aclnnGcd | Computes the element-wise greatest common divisor of the given self and other, where both self and other must be integers. | Default | Default |
| aclnnGer | Computes the outer product of self and vec2. | Default | Default |
| aclnnGeScalar&aclnnInplaceGeScalar | Determines whether each element in the input tensor is greater than or equal to the other scalar value, and returns a Bool-type tensor indicating whether the greater-than-or-equal-to condition holds at each position of the input tensor. | Default | Default |
| aclnnGeTensor&aclnnInplaceGeTensor | Determines whether each element in the input tensor is greater than or equal to the corresponding element in the other tensor, and returns a Bool-type tensor indicating whether the greater-than-or-equal-to condition holds at each position of the input tensor. | Default | Default |
| aclnnGlobalAveragePool | Applies average pooling over the values in the same channel of an input tensor X. | Default | Default |
| aclnnGlobalMaxPool | Takes the maximum value over the values in the same channel of an input tensor. | Default | Default |
| aclnnGtScalar&aclnnInplaceGtScalar | Determines whether each element in the input tensor is greater than the other scalar value, and returns a Bool-type tensor indicating whether the greater-than condition holds at each position of the input tensor. | Default | Default |
| aclnnGtTensor&aclnnInplaceGtTensor | Determines whether each element in the self tensor is greater than the corresponding element in the other tensor. Returns a tensor where True (1) indicates self > other, and False (0) otherwise. | Default | Default |
| aclnnGroupedBiasAddGrad | Performs backward propagation of the grouped bias addition (GroupedBiasAdd). | Default | Default |
| aclnnGroupedBiasAddGradV2 | Performs the backward computation of groupBiasAdd. This API extends the functionality of the aclnnGroupedBiasAddGrad API by adding the groupIdxType attribute, which supports specifying the type of groupIdx. | Default | Default |
| aclnnHansDecode | Decodes a compressed tensor based on PDF and reconstructs the tensor based on the mantissa. | Default | - |
| aclnnHansEncode | Performs PDF statistics on the byte where the exponent bits of the tensor reside, and performs lossless compression based on the PDF distribution statistics. | Default | - |
| aclnnHardtanh&aclnnInplaceHardtanh | Clamps all elements of the input to the range [clipValueMin, clipValueMax]. If an element is greater than clipValueMax, it is clamped to clipValueMax; if an element is less than clipValueMin, it is clamped to clipValueMin; otherwise, it remains unchanged. | Default | Default |
| aclnnHistc | Uses min and max as the statistical bounds, divides the range between min and max into bins of equal width, and counts the number of elements of the tensor self that fall into each bin. If min and max are equal, the minimum and maximum values of all elements in the tensor are used as the statistical bounds. Elements less than min or greater than max are not counted. | Default | Default |
| aclnnIm2col | Extracts sliding local blocks from a batched input tensor and rearranges them into columns, concatenating them into a large tensor. | Default | Default |
| aclnnInplaceAdds | Performs addition. | Default | Default |
| aclnnInplaceBitwiseAndScalar | Computes the bitwise AND of each element in the input tensor and the input scalar other. The input tensor and other must be of integer type or BOOL type. When the input is of BOOL type, computes the logical AND. | Default | Default |
| aclnnInplaceBitwiseAndTensor | Performs a logical AND operation when the input is a BOOL-type tensor; performs a bitwise AND operation when the input is of INT type. | Default | Default |
| aclnnInplaceCopy | Copies the elements from src to the selfRef tensor and returns selfRef. | Default | Default |
| aclnnInplaceFillDiagonal | Fills the diagonal of the tensor with fillValue. | Default | - |
| aclnnInplaceFillScalar | Fills the tensor with a specified scalar. | Default | Default |
| aclnnInplaceFillTensor | Fills the selfRef tensor with value, where value is a tensor. | Default | Default |
| aclnnInplaceMaskedFillScalar | Fills the elements in selfRef corresponding to the positions where the mask matrix is true with value. | Default | Default |
| aclnnInplaceMaskedFillTensor | Fills the elements in selfRef corresponding to the positions where the mask matrix is true with value. | Default | Default |
| aclnnInplaceNormal | Fills the tensor with elements drawn from a normal distribution parameterized by mean and std. Draws random numbers from a discrete normal distribution with the given mean and standard deviation std to fill the selfRef tensor. The mean is a base type float containing the mean of the normal distribution for each output element. std is a base type float containing the standard deviation of the normal distribution for each output element. | Default | Default |
| aclnnInplaceNormalTensor | Fills the tensor with elements drawn from a normal distribution parameterized by mean and std. | Default | Default |
| aclnnInplaceOne | Returns a tensor of the same shape and type with all elements set to 1. | Default | Default |
| aclnnInplaceRandom | Fills the selfRef tensor with numbers sampled from a discrete uniform distribution over [from, to-1]. | Default | Default |
| aclnnInplaceRandomTensor | Fills the selfRef tensor with numbers sampled from a discrete uniform distribution over [from, to-1]. | Default | Default |
| aclnnInplaceUniform | Generates random numbers from a discrete uniform distribution over the interval [from, to) and fills them into the selfRef tensor. (The BOOL type of this API is deprecated. If needed, use the aclnnBernoulli or aclnnInplaceBernoulli API instead.) | Default | Default |
| aclnnInplaceUniformTensor | Generates random numbers from a discrete uniform distribution over the interval [from, to) and fills them into the selfRef tensor. | Default | Default |
| aclnnInplaceZero | Fills the selfRef tensor with all zeros. | Default | Default |
| aclnnIsClose | Returns a new tensor with Boolean elements, indicating whether the given self and other are close to each other. Returns True if the values are close, and False otherwise. | Default | Default |
| aclnnIsFinite | Determines which elements in the tensor are finite values, i.e., not inf, -inf, or nan. | Default | Default |
| aclnnIsInf | Determines which elements in the tensor are infinite values, i.e., inf or -inf. | Default | Default |
| aclnnIsInScalarTensor | Checks whether the elements in element are equal to testElement. | Default | Default |
| aclnnIsInTensorScalar | Checks whether the elements in element are equal to testElement. | Default | Default |
| aclnnIsNegInf | Determines whether the elements of the input tensor are negative infinity. | Default | Default |
| aclnnIsPosInf | Determines whether the elements of the input tensor are positive infinity. | Default | Default |
| aclnnKlDiv | Computes the KL divergence. | Default | Default |
| aclnnLeftShift | Performs a bitwise left shift on each element in the input tensor self according to the corresponding parameter in the input tensor shiftBits. | Default | Default |
| aclnnLeftShifts | Performs a bitwise left shift on each element in the input tensor self according to the input scalar shiftBits. | Default | Default |
| aclnnLerp&aclnnInplaceLerp | Performs linear interpolation between the start and end tensors based on the given weight, and returns the interpolated tensor. | Default | Default |
| aclnnLerps&aclnnInplaceLerps | Performs linear interpolation between the start and end tensors based on the given weight, and returns the interpolated tensor. | Default | Default |
| aclnnLeScalar&aclnnInplaceLeScalar | Determines whether each element value in the input self is less than or equal to the value of other, and writes the comparison result of each element of self with other into out. | Default | Default |
| aclnnLeTensor&aclnnInplaceLeTensor | Computes whether each element value in self is less than or equal to the corresponding value in other, and writes the comparison result of each element of self with other into out. | Default | Default |
| aclnnLgamma | Performs the lgamma mathematical operation on each element of the input tensor. | Default | - |
| aclnnLinspace | Generates an evenly spaced sequence of values. | Default | Default |
| aclnnLinalgCholesky | Computes the Cholesky decomposition of a real symmetric positive-definite matrix. | Default | - |
| aclnnLinalgCross | Performs the linear_cross operation on the input tensor. | Default | Default |
| aclnnLinalgQr | Performs orthogonal decomposition on the input tensor. | Default | - |
| aclnnLogSpace | Creates a one-dimensional tensor of size $\text{steps}$ whose values are evenly spaced on a logarithmic scale from $\text{base}^\text{start}$ to $\text{base}^\text{end}$, inclusive, with $\text{base}$ as the base. | Default | - |
| aclnnLog&aclnnInplaceLog | Computes the natural logarithm. | Default | Default |
| aclnnLog2&aclnnInplaceLog2 | Computes the base-2 logarithm. | Default | Default |
| aclnnLog10&aclnnInplaceLog10 | Computes the base-10 logarithm of the input. | Default | Default |
| aclnnLog1p&aclnnInplaceLog1p | Performs the log1p operation on the input tensor. | Default | Default |
| aclnnLogAddExp | Computes the logarithm (base e) of the sum of exponentials of the input tensors. | Default | - |
| aclnnLogAddExp2 | Computes the logarithm (base 2) of the sum of exponentials of the input tensors. | Default | - |
| aclnnLogdet | Computes the natural logarithm of the determinant of the input self. | Default | Default |
| aclnnLogicalAnd&aclnnInplaceLogicalAnd | Performs the element-wise logical AND operation on the given input tensors. 0 is treated as False, and non-zero is treated as True. | Default | Default |
| aclnnLogicalNot&aclnnInplaceLogicalNot | Computes the element-wise logical NOT of the given input tensor. If the output type is not specified, the output tensor is of bool type. | Default | Default |
| aclnnLogicalOr&aclnnInplaceLogicalOr | Performs the element-wise logical OR operation on the given input tensors. When both input tensors are of non-bool type, 0 is treated as False, and non-zero is treated as True. | Default | Default |
| aclnnLogicalXor | Performs the element-wise logical XOR operation on the given input tensors. When self and other are of non-bool type, 0 is treated as False, and non-zero is treated as True. | Default | Default |
| aclnnLogSumExp | Returns the logarithm of the sum of exponentials of the input tensor along the specified dimensions. | Default | Default |
| aclnnLtScalar&aclnnInplaceLtScalar | Determines whether each element in the input self is less than the input other value, and returns a Bool-type tensor. | Default | Default |
| aclnnLtTensor&aclnnInplaceLtTensor | Determines whether each element in the input self is less than the corresponding element in the input other, and returns a Bool-type tensor. | Default | Default |
| aclnnMaskedScale | Performs element-wise computation. | Default | Default |
| aclnnMaskedSelect | Selects elements from the input tensor (self) based on a Boolean mask tensor (mask) as the output, forming a new one-dimensional tensor. | Default | Default |
| aclnnMatmulCompressDequant | When performing l@r matrix multiplication, the r matrix can be losslessly compressed using the msModelSlim tool to reduce its memory footprint, and then this API completes lossless decompression, matrix multiplication, and dequantization. | - | - |
| aclnnMaxDim | Returns the maximum values and their indices along the specified dimension of the tensor. | Default | Default |
| aclnnMax | Returns the maximum value among all elements of the tensor. | Default | Default |
| aclnnMaximum | Computes the element-wise maximum of two tensors and returns a new tensor. | Default | Default |
| aclnnMaxN | Computes the element-wise maximum across the corresponding elements of each input tensor in the input tensor list. | Default | Default |
| aclnnMaxV2 | Computes the element-wise maximum of the input tensor along the specified dimension. | Default | Default |
| aclnnMean | Computes the mean of the tensor along the specified dimensions. | Default | Default |
| aclnnMeanV2 | Computes the mean of the tensor along the specified dimensions. | Default | Default |
| aclnnMin | Returns the minimum value among all elements of the tensor. | Default | Default |
| aclnnMinDim | Returns the minimum values and their indices along the specified dimension of self. | Default | Default |
| aclnnMinimum | Computes the element-wise minimum of two tensors and returns a new tensor. | Default | Default |
| aclnnMinN | Computes the element-wise minimum across the corresponding elements of each input tensor in the input tensor list. | Default | Default |
| aclnnMul&aclnnInplaceMul | Performs multiplication between tensors. | Default | Default |
| aclnnMuls&aclnnInplaceMuls | Performs multiplication between a tensor and a scalar. | Default | Default |
| aclnnMultinomial | Draws numsamples samples from the input tensor based on the probability distribution of each object, and stores the indices of these samples in the output tensor. | Default | Default |
| aclnnMultinomialTensor | Draws numsamples samples from the input tensor based on the probability distribution of each object, and stores the indices of these samples in the output tensor. | Default | - |
| aclnnNanToNum&aclnnInplaceNanToNum | Replaces NaN, positive infinity, and negative infinity values in the input with the values specified by nan, posinf, and neginf, respectively. | Default | Default |
| aclnnNeg&aclnnInplaceNeg | Computes the negation of each element of the input. | Default | Default |
| aclnnNeScalar&aclnnInplaceNeScalar | Computes whether the value of each element in selfRef is not equal to the value of other. | Default | Default |
| aclnnNeTensor&aclnnInplaceNeTensor | Computes whether the value of each element in self (selfRef) is not equal to the corresponding value in other. | Default | Default |
| aclnnNormalFloatFloat | Returns a tensor of random numbers drawn from independent normal distributions with the given mean (float) and standard deviation (float). | Default | |
| aclnnNormalFloatTensor | Returns a tensor of random numbers drawn from independent normal distributions with the given mean (float) and standard deviation (tensor). | Default | Default |
| aclnnNormalTensorFloat | Returns a tensor of random numbers drawn from independent normal distributions with the given mean (tensor) and standard deviation (float). | Default | Default |
| aclnnNormalTensorTensor | Returns a random number drawn from independent normal distributions with the given mean (tensor) and standard deviation (tensor). | Default | Default |
| aclnnNpuFormatCast | Performs ND ↔ NZ format conversion. | Default | |
| aclnnOneHot | Applies one-hot encoding to the input self of length n, producing an output out with n*k elements. | Default | Default |
| aclnnPdist | Computes the p-norm distance between each pair of row vectors in the input self. | Default | - |
| aclnnPdistForward | Computes the p-norm distance of each pair of row vectors in the input self. | Default | - |
| aclnnPermute | Permutes arbitrary dimensions 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]. | Default | Default |
| aclnnPolar | Converts the absolute value and angle of the input to Cartesian coordinates, producing a complex tensor out. | Default | - |
| aclnnPowScalarTensor | Raises each element of exponent to the power of the corresponding element in input. | Default | Default |
| aclnnPowTensorScalar&aclnnInplacePowTensorScalar | Raises each element of exponent to the power of the corresponding element in input. | Default | Default |
| aclnnPowTensorTensor&aclnnInplacePowTensorTensor | Raises each element of exponent to the power of the corresponding element in input. | Default | Default |
| aclnnPrecisionCompare | Compares whether elements of two tensors are identical for precision comparison, and returns the status code of the operator execution without triggering management plane fault reporting. | Default | Default |
| aclnnProd | Returns the product of all elements in the input tensor. | Default | Default |
| aclnnProdDim | Returns the product of each row along the given dimension of the input tensor. | Default | Default |
| aclnnQr | Performs orthogonal decomposition on the input tensor. | Default | - |
| aclnnRandperm | Returns a random permutation of integers from 0 to n-1. | Default | Default |
| aclnnRange | Generates values from start to end with a step interval. | Default | Default |
| aclnnReal | Extracts the real part of each element in the input tensor. | Default | - |
| aclnnReciprocal&aclnnInplaceReciprocal | Returns a new tensor with the reciprocal of each input element. | Default | Default |
| aclnnReduceLogSum | Returns the logarithm of the sum of each row in the input tensor along the given dimension. | Default | - |
| aclnnReduceNansum | Treats NaN values in the tensor as 0, then returns the sum of the input tensor along the given dimension. | Default | - |
| aclnnReduceSum | Returns the sum of each row in the input tensor along the given dimension. | Default | Default |
| aclnnReflectionPad1d | Pads the input tensor using the reflection of the input boundary. | Default | Default |
| aclnnReflectionPad2d | Pads the input tensor using the reflection of the input boundary. | Default | Default |
| aclnnReflectionPad3d | Performs 3D reflection padding. | Default | Default |
| aclnnRemainderScalarTensor | Broadcasts the scalar self to a tensor with the same shape as tensor other, then converts each element to the remainder obtained by dividing by the corresponding element of other. | Default | Default |
| aclnnRemainderTensorScalar&aclnnInplaceRemainderTensorScalar | Converts each element in tensor self to the remainder obtained by dividing by the scalar other. | Default | Default |
| aclnnRemainderTensorTensor&aclnnInplaceRemainderTensorTensor | Broadcasts tensor self and tensor other to a consistent shape, then converts each element to the remainder obtained by dividing by the corresponding element of other. | Default | Default |
| aclnnRepeat | Repeats the input tensor along each dimension according to the replication counts specified in repeats. | Default | Default |
| aclnnReplicationPad1d | Pads the last dimension of the input tensor using the input boundary. | Default | Default |
| aclnnReplicationPad2d | Pads the last two dimensions of the input tensor using the input boundary. | Default | Default |
| aclnnReplicationPad3d | Pads the last three dimensions of the input tensor using the input boundary. | Default | Default |
| aclnnReflectionPad1d | Invokes the mirror_pad operator in REFLECT mode to pad the last dimension of the input tensor. | Default | Default |
| aclnnReflectionPad2d | Invokes the mirror_pad operator in REFLECT mode to pad the last two dimensions of the input tensor. | Default | Default |
| aclnnReflectionPad3d | Invokes the mirror_pad operator in REFLECT mode to pad the last three dimensions of the input tensor. | Default | Default |
| aclnnReplicationPad1dBackward | Computes the backward propagation of replication_pad1d. | Default | Default |
| aclnnReplicationPad2dBackward | Computes the backward propagation of replication_pad2d. For forward computation, see aclnnReplicationPad2d. | Default | Default |
| aclnnReplicationPad3dBackward | Computes the backward propagation of aclnnReplicationPad3d. | Default | Default |
| aclnnReflectionPad1dBackward | Computes the backward propagation of reflection_pad1d. For forward computation, see aclnnReflectionPad1d. | Default | Default |
| aclnnReflectionPad2dBackward | Computes the backward propagation of reflection_pad2d. For forward computation, see aclnnReflectionPad2d. | Default | Default |
| aclnnReflectionPad3dBackward | Computes the backward propagation of the aclnnReflectionPad3d API. | Default | Default |
| aclnnRightShift | Performs a bitwise right shift on each element of the input tensor input according to the corresponding position parameter in the input tensor shiftBits. | Default | Default |
| aclnnRoll | Shifts data in the tensor along given sizes and dimensions. | Default | Default |
| aclnnRound&aclnnInplaceRound | Rounds the input value to the nearest integer. If the value is equidistant from two integers, rounds to the nearest even integer. | Default | Default |
| aclnnRoundDecimals&aclnnInplaceRoundDecimals | Rounds the elements of the input tensor to the specified number of decimal places. | Default | Default |
| aclnnRsqrt&aclnnInplaceRsqrt | Computes the reciprocal of the square root of each element in input (Tensor). | Default | Default |
| aclnnRsub | Performs subtraction. | Default | Default |
| aclnnRsubs | Performs subtraction. | Default | Default |
| aclnnScale | See the operator documentation. | Default | - |
| aclnnSearchSorted | Finds the indices where the given tensor values (self) should be inserted in a sorted tensor (sortedSequence). | Default | - |
| aclnnSearchSorteds | Finds the index where the given scalar value (self) should be inserted in a sorted one-dimensional tensor (sortedSequence). Returns a tensor with shape [1] indicating the position where the given scalar value should be inserted in the original tensor. If self is of Tensor type, see the document aclnnSearchSorted. | Default | - |
| aclnnSign | Applies the Sign function element-wise to the input tensor and outputs the result tensor. | Default | Default |
| aclnnSignbit | Determines whether the sign bit of each element in the input is 1, and returns a bool-type tensor. | Default | Default |
| aclnnSignBitsPack | Packs 1-bit Adam of float16 or float32 type into uint8. | Default | - |
| aclnnSignBitsUnpack | Unpacks uint8-type 1-bit Adam into float32 or float16. | Default | - |
| aclnnSilentCheck | Compares the input feature value (val) against absolute and relative thresholds to identify whether a silent detection fault is triggered. | Default | - |
| aclnnSilentCheckV2 | Identifies whether a silent detection fault is triggered based on the stepRef parameter and the Markov inequality threshold. | Default | - |
| aclnnSimThreadExponential | Generates random numbers following an exponential distribution with parameter lambda and fills them into the selfRef tensor. | Default | - |
| aclnnSin&aclnnInplaceSin | Performs the sin operation on the input tensor. | Default | Default |
| aclnnSinc&aclnnInplaceSinc | Performs the sinc operation on the input tensor. | Default | - |
| aclnnSinh&aclnnInplaceSinh | Performs the sinh operation on the input tensor. | Default | - |
| aclnnSinkhorn | Computes the Sinkhorn distance, which can be used for expert routing in MoE models. | Default | - |
| aclnnSlice | Extracts a sub-tensor out from the input tensor self along the specified dimension dim, based on the given range [start, end] and step size step. | Default | Default |
| aclnnSliceV2 | Extracts a tensor out from the input tensor self based on the given axes, ranges [starts, ends], and step sizes steps. | Default | Default |
| aclnnSlogdet | Computes the sign and natural logarithm of the determinant of the input self. | Default | Default |
| aclnnSort | Sorts the elements in the input tensor in ascending or descending order along the specified dimension, and returns the corresponding index values. | Default | Default |
| aclnnSplitTensor | Splits the input self evenly along the dim axis according to the splitSections size. | Default | Default |
| aclnnSplitWithSize | Splits the input self along the dim axis into segments of sizes specified by each element in splitSize. | Default | Default |
| aclnnSqrt&aclnnInplaceSqrt | Computes the square root of non-negative numbers. Returns NaN for negative inputs. | Default | Default |
| aclnnSquare | Computes the square of each element in the input tensor. | Default | Default |
| aclnnStack | Concatenates a sequence of tensors along a new dimension. | Default | Default |
| aclnnStd | Computes the standard deviation along the specified dimension (dim), which can be a single dimension, a list of dimensions, or None. | Default | Default |
| aclnnStdMeanCorrection | Computes the sample standard deviation and mean. | Default | Default |
| aclnnStridedSlice | StridedSliceAssign is a tensor slice assignment operation that extracts a sub-tensor from the input tensor according to the specified start, end positions, and stride. | Default | Default |
| aclnnStridedSliceAssignV2 | StridedSliceAssign is a tensor slice assignment operation that assigns the content of the tensor inputValue to the specified positions in the target tensor varRef. | Default | Default |
| aclnnSub&aclnnInplaceSub | Performs subtraction, with the subtrahend scaled by alpha. | Default | Default |
| aclnnSubs&aclnnInplaceSubs | Performs subtraction, with the subtrahend scaled by alpha. | Default | Default |
| aclnnSum | Returns the result of sequentially performing add summation on each input tensor in the input tensors list. | Default | - |
| aclnnSvd | Computes the singular value decomposition of one or more matrices. | Default | - |
| aclnnSWhere | Selects elements from self or other based on a condition and returns the result (broadcasting is supported). | Default | Default |
| aclnnTan&aclnnInplaceTan | Computes the tangent of each element in the input tensor self and stores the result in the output tensor out. | Default | - |
| aclnnTanh&aclnnInplaceTanh | An activation function. Returns a tensor with the same shape as the input tensor, performing element-wise computation on the input tensor. | Default | Default |
| aclnnTanhBackward | Computes the backward propagation of aclnnTanh. | Default | Default |
| aclnnTopk | Returns the k extreme values and their indices of the input tensor along the specified dimension. | Default | Default |
| aclnnTrace | Computes the sum of the elements on the main diagonal starting from the top-left corner of the matrix. | Default | - |
| aclnnTransformBiasRescaleQkv | The TransformBiasRescaleQkv operator is an API for processing Query, Key, and Value vectors in multi-head attention mechanisms. | Default | |
| aclnnTransConvolutionWeight | Used in conjunction with the aclnnCalculateConvolutionWeightSize API to create a weight tensor that is performance-friendly for the Convolution operator. | Default | - |
| aclnnTransMatmulWeight | Used in conjunction with the aclnnCalculateMatmulWeightSize and aclnnCalculateMatmulWeightSizeV2 APIs to create a weight tensor that is performance-friendly for the Matmul operator. | Default | |
| aclnnTriangularSolve | Solves a system of equations with a square upper or lower triangular invertible matrix A and multiple right-hand sides b. | Default | Default |
| aclnnTril&aclnnInplaceTril | Zeros out the upper-right part of the last two dimensions (counted from left to right by shape) of the input self tensor along the diagonal. | Default | Default |
| aclnnTriu&aclnnInplaceTriu | Zeros out the lower-left part of the last two dimensions (counted from left to right by shape) of the input self tensor along the diagonal. | Default | Default |
| aclnnTrunc&aclnnInplaceTrunc | Performs the trunc operation on the input tensor (truncates the fractional part of the number and returns the integer part). | Default | Default |
| aclnnUnfoldGrad | Implements the backward function of the Unfold operator and computes the corresponding gradient. | Default | |
| aclnnVar | Returns the variance computed from the values of the input tensor along the specified dimension. | Default | Default |
| aclnnVarCorrection | Returns the variance computed from the values of the input tensor along the specified dimension. | Default | Default |
| aclnnVarMean | Returns the mean and variance computed from the values of the input tensor along the specified dimension. | Default | Default |
| aclnnXLogYScalarOther&aclnnInplaceXLogYScalarOther | Computes the result of self * log(other). | Default | - |
| aclnnXLogYScalarSelf | Computes the result of self * log(other). | Default | - |
| aclnnXLogYTensor&aclnnInplaceXLogYTensor | Computes the result of self * log(other). | Default | - |
| aclRfft1D | Performs RFFT (Fourier transform) computation on the input tensor self, producing a complex tensor containing non-negative frequencies. | Default | - |
| aclStft | Computes the Fourier transform of the input within sliding windows. | Default | - |