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/aclnnop and the library file is stored in ${INSTALL_DIR}/lib64.

    • Header file: 1. Method 1 (recommended): Reference the general header file aclnn_ops_{ops_project}.h of 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.

  • 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 NameDescriptionDeterminism (A2/A3)Determinism (Ascend 950)
aclnnAbsCalculates the absolute value of a tensor.Enabled by defaultEnabled by default
aclnnAcos&aclnnInplaceAcosPerforms the arc cosine operation on each element of the input matrix and outputs the result.Enabled by defaultEnabled by default
aclnnAcosh&aclnnInplaceAcoshPerforms the inverse hyperbolic cosine operation on each element of the input tensor and outputs the result.Enabled by defaultEnabled by default
aclnnAdd&aclnnInplaceAddPerforms the addition computation.Enabled by defaultEnabled by default
aclnnAddcdiv&aclnnInplaceAddcdivPerforms the addition computation.Enabled by defaultEnabled by default
aclnnAddcmul&aclnnInplaceAddcmulMultiplies 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 defaultEnabled by default
aclnnAddLoraAdds the Low-Rank Adaptation (LoRA) layer to a neural network to reduce the number of parameters through low-rank factorization.Enabled by default-
aclnnAddNAdds the main elements of the input.Enabled by defaultEnabled by default
aclnnAddr&aclnnInplaceAddrCalculates 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 defaultEnabled by default
aclnnAdds&aclnnInplaceAddsPerforms the addition computation.Enabled by defaultEnabled by default
aclnnAddV3&aclnnInplaceAddV3Performs the addition computation.-Enabled by default
aclnnAffineGridGiven 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-
aclnnAllFor 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 defaultEnabled by default
aclnnAmaxReturns the maximum value of each slice of a tensor in a specified dimension (specified by dim).Enabled by defaultEnabled by default
aclnnAminReturns the minimum value of each slice of a tensor in a specified dimension (specified by dim).Enabled by defaultEnabled by default
aclnnAminmaxReturns the minimum and maximum values of each row of the input tensor in the specified dimension.Enabled by defaultEnabled by default
aclnnAminmaxAllReturns the minimum and maximum values of the input tensor in all dimensions.Enabled by defaultEnabled by default
aclnnAminmaxDimReturns the minimum and maximum values of the input tensor in specified dimensions.Enabled by defaultEnabled by default
aclnnAngleV2Angle of each element of the input tensor (unit: radian).Enabled by defaultEnabled by default
aclnnAnyFor 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 defaultEnabled by default
aclnnArangeObtains 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 defaultEnabled by default
aclnnArgMaxReturns the maximum value index of a tensor in a specified dimension (dim) and saves it to the out tensor.Enabled by defaultEnabled by default
aclnnArgMinReturns the minimum value index of the specified axis in the tensor and saves it to out.Enabled by defaultEnabled by default
aclnnArgsortSorts elements of the input tensor in ascending or descending order along a specified dimension, and returns the corresponding indices.Enabled by defaultEnabled by default
aclnnAsin&aclnnInplaceAsinPerforms the arcsine operation on each element of the input matrix and outputs the result.Enabled by defaultEnabled by default
aclnnAsinh&aclnnInplaceAsinhComputes the inverse hyperbolic sine of each element in the input tensor.Enabled by defaultEnabled by default
aclnnAtan&aclnnInplaceAtanComputes the arctangent of each element in the input matrix.Enabled by defaultEnabled by default
aclnnAtan2&aclnnInplaceAtan2Performs the element-wise arctangent operation on the input tensors self and other.Enabled by defaultEnabled by default
aclnnAtanh&aclnnInplaceAtanhPerforms the inverse hyperbolic tangent operation on each element in the input tensor and outputs the result.Enabled by defaultEnabled by default
aclnnBatchNormStatsComputes the mean value and the reciprocal of the standard deviation for the input data of a single card.Enabled by defaultEnabled by default
aclnnBernoulli&aclnnInplaceBernoulliExtracts 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 defaultEnabled by default
aclnnBernoulliTensor&aclnnInplaceBernoulliTensorExtracts 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 defaultEnabled by default
aclnnBincountComputes the frequency of each number in a non-negative integer array.Enabled by defaultDisabled by default. Can be enabled.
aclnnBitwiseAndScalarComputes the bitwise AND result of each element in the input tensor and the input scalar.Enabled by defaultEnabled by default
aclnnBitwiseAndTensorPerforms 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 defaultEnabled by default
aclnnBitwiseAndTensorOut&aclnnInplaceBitwiseAndTensorOutPerforms 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
aclnnBitwiseNotPerforms 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 defaultEnabled by default
aclnnBitwiseOrScalar&aclnnInplaceBitwiseOrScalarComputes the bitwise OR between elements in the input tensor self and the input scalar other.Enabled by defaultEnabled by default
aclnnBitwiseOrTensor&aclnnInplaceBitwiseOrTensorComputes the bitwise OR between elements in the tensor self and corresponding elements in the tensor other.Enabled by defaultEnabled by default
aclnnBitwiseXorScalar&aclnnInplaceBitwiseXorScalarComputes 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 defaultEnabled by default
aclnnBitwiseXorTensor&aclnnInplaceBitwiseXorTensorComputes 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 defaultEnabled by default
aclnnCalculateConvolutionWeightSizeCalculates 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-
aclnnCalculateMatmulWeightSizeCalculates 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 defaultEnabled by default
aclnnCalculateMatmulWeightSizeV2Calculates 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 defaultEnabled by default
aclnnCastConverts the tensor data type.Enabled by defaultEnabled by default
aclnnCatConcatenates all tensors in the tensor list by dim.Enabled by defaultEnabled by default
aclnnCdistCalculates the p-norm distance between points in two vector sets.Enabled by default-
aclnnCdistBackwardReverses aclnnCdist.Enabled by defaultEnabled by default
aclnnCeil&aclnnInplaceCeilReturns the round-up result of each element in the input tensor.Enabled by defaultEnabled by default
aclnnChannelShuffleDivides 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 defaultEnabled by default
aclnnChunkCatSplits 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 defaultEnabled by default
aclnnCircularPad2dPads the last two dimensions of the input tensor using circular padding of the input boundary.Enabled by defaultEnabled by default
aclnnCircularPad2dBackwardPerforms backpropagation of circular_pad2d. For details about the forward propagation, see aclnnCircularPad2d.Enabled by defaultEnabled by default
aclnnCircularPad3dPads the last three dimensions of the input tensor using circular padding of the input boundary.Enabled by defaultEnabled by default
aclnnCircularPad3dBackwardPerforms backpropagation of aclnnCircularPad3d.Enabled by defaultEnabled by default
aclnnClampLimits 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 defaultEnabled by default
aclnnClampMax&aclnnInplaceClampMaxLimits all input elements within the range of [-inf, max].Enabled by defaultEnabled by default
aclnnClampMaxTensor&aclnnInplaceClampMaxTensorLimits all input elements within the range of [-inf, max].Enabled by defaultEnabled by default
aclnnClampMinLimits all input elements within the range of [min, inf].Enabled by defaultEnabled by default
aclnnClampMinTensor&aclnnInplaceClampMinTensorLimits all input elements within the range of [min, inf].Enabled by defaultEnabled by default
aclnnClampTensorLimits 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 defaultEnabled by default
aclnnComplexTwo input tensors with the same shape, broadcast relationship, and Dtype.Enabled by defaultEnabled by default
aclnnConfusionTransposeFuses the reshape and transpose operations.Enabled by defaultEnabled by default
aclnnConstantPadNdPads the input tensor self with data based on the pad parameter. The padded data is specified by value.Enabled by defaultEnabled by default
aclnnCos&aclnnInplaceCosPerforms the cosine operation on each element of the input matrix and outputs the result.Enabled by defaultEnabled by default
aclnnCosh&aclnnInplaceCoshFunctions 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 defaultEnabled by default
aclnnCummaxComputes the cumulative maximum value in self and returns the maximum value and the corresponding index.Enabled by default-
aclnnCumminComputes the cumulative minimum value in self and returns the minimum value and the corresponding index.Enabled by defaultEnabled by default
aclnnCumprod&aclnnInplaceCumprodThe 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-
aclnnCumsumComputes 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 defaultEnabled by default
aclnnCumsumV2Computes 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 defaultEnabled by default
aclnnDiagIf 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 defaultEnabled by default
aclnnDiagFlatGenerates 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 defaultEnabled by default
aclnnDigammaPerforms the digamma mathematical operation on each element of the input tensor.Enabled by defaultEnabled by default
aclnnDiv&aclnnInplaceDivPerforms division.Enabled by defaultEnabled by default
aclnnDivMod&aclnnInplaceDivModPerforms the division operation and selects the rounding operation based on the mode parameter.Enabled by defaultEnabled by default
aclnnDivMods&aclnnInplaceDivModsPerforms the division operation and selects the rounding operation based on the mode parameter.Enabled by defaultEnabled by default
aclnnDivs&aclnnInplaceDivsPerforms division.Enabled by defaultEnabled by default
aclnnDotComputes the dot product of two 1D tensors.Enabled by defaultEnabled by default
aclnnDropoutIn 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-
aclnnDropoutBackwardDuring 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 defaultEnabled by default
aclnnDropoutDoMaskRandomly 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 defaultEnabled by default
aclnnDropoutGenMaskDuring training, a mask is generated based on the probability prob for element zeroing.Enabled by defaultEnabled by default
aclnnDropoutGenMaskV2During training, a mask is generated based on the probability prob for element zeroing.Enabled by defaultEnabled by default
aclnnDropoutGenMaskV2TensorDuring training, a mask is generated based on the probability prob for element zeroing.Enabled by defaultEnabled by default
aclnnDropoutV3Randomly 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 defaultEnabled by default
aclnnDropoutV3GradZeros the elements in the input based on the input mask and scales the output based on the scale.-Enabled by default
aclnnEqScalar&aclnnInplaceEqScalarCompares the values of elements in self with those in other, and writes the comparison result to out.Enabled by defaultEnabled by default
aclnnEqTensor&aclnnInplaceEqTensorChecks 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 defaultEnabled by default
aclnnEqualChecks whether two tensors have the equal size and elements. A Boolean value is returned.Enabled by defaultEnabled by default
aclnnErf&aclnnInplaceErfReturns the value of the error function corresponding to each element in the input tensor.Enabled by defaultEnabled by default
aclnnErfc&aclnnInplaceErfcReturns the value of the complementary error function corresponding to each element in the input tensor.Enabled by defaultEnabled by default
aclnnExp&aclnnInplaceExpReturns a new tensor where each element is the exponential of the corresponding element in the input.Enabled by defaultEnabled by default
aclnnExp2&aclnnInplaceExp2Each element of self is used as the power of base 2 for computation.Enabled by defaultEnabled by default
aclnnExpandBroadcasts the input tensor self to a tensor of a specified size.Enabled by defaultEnabled by default
aclnnExpm1&aclnnInplaceExpm1Calculates the power of the natural constant e using the input self as the exponent, and subtracts 1 from the exponentiation result.Enabled by defaultEnabled by default
aclnnExpSegsumPerforms segmentation and computation. Generate a semi-separable matrix with a diagonal of 1 and an upper triangle of 0.Enabled by default-
aclnnExpSegsumBackwardPerforms reverse computation of aclnnExpSegsum.Enabled by default-
aclnnEyeReturns 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 defaultEnabled by default
aclnnFlattenFlattens the input tensor into a 2D tensor based on the given axis.Enabled by defaultEnabled by default
aclnnFloor&aclnnInplaceFloorReturns the result after each element in the input tensor is rounded down and writes back the result to the input tensor.Enabled by defaultEnabled by default
aclnnFloorDivide&aclnnInplaceFloorDividePerforms division and rounds down the remainder.Enabled by defaultEnabled by default
aclnnFloorDivides&aclnnInplaceFloorDividesPerforms division and rounds down the remainder.Enabled by defaultEnabled by default
aclnnFmodScalar&aclnnInplaceFmodScalarReturns the remainder of self divided by other.Enabled by defaultEnabled by default
aclnnFmodTensor&aclnnInplaceFmodTensorReturns the remainder of self divided by other.Enabled by defaultEnabled by default
aclnnFrac&aclnnInplaceFracCalculates the decimal part of each element in the input tensor and then outputs the result.Enabled by defaultEnabled by default
aclnnGcdComputes the element-wise greatest common divisor (GCD) of specified self and other. Both self and other must be integers.Enabled by defaultEnabled by default
aclnnGerImplements outer product of self and vec2.Enabled by defaultEnabled by default
aclnnGeScalar&aclnnInplaceGeScalarDetermines 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 defaultEnabled by default
aclnnGeTensor&aclnnInplaceGeTensorDetermines 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 defaultEnabled by default
aclnnGlobalAveragePoolApplies average pooling to values in the same channel for the input tensor X.Enabled by defaultEnabled by default
aclnnGlobalMaxPoolObtains the maximum value in the same channel for the input tensor.Enabled by defaultEnabled by default
aclnnGroupedBiasAddGradPerforms backpropagation of GroupedBiasAdd.Enabled by defaultEnabled by default
aclnnGroupedBiasAddGradV2Implement 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 defaultEnabled by default
aclnnGtScalar&aclnnInplaceGtScalarDetermines 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 defaultEnabled by default
aclnnGtTensor&aclnnInplaceGtTensorDetermines 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 defaultEnabled by default
aclnnHansDecodeThe compressed tensor is decoded based on PDF, and the restored tensor is reassembled based on mantissa (mantissa).Enabled by defaultEnabled by default
aclnnHansEncodePerforms 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 defaultEnabled by default
aclnnHardtanh&aclnnInplaceHardtanhLimits 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 defaultEnabled by default
aclnnHistcThe 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 defaultDisabled by default. Can be enabled.
aclnnIm2colRearranges 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 defaultEnabled by default
aclnnInplaceBitwiseAndScalarComputes 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 defaultEnabled by default
aclnnInplaceBitwiseAndTensorPerforms 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 defaultEnabled by default
aclnnInplaceCopyCopies elements in src to the selfRef tensor and returns selfRef.Enabled by defaultEnabled by default
aclnnInplaceFillDiagonalFills the diagonal of a tensor with fillValue.Enabled by default-
aclnnInplaceFillScalarFills a specified scalar to a tensor.Enabled by defaultEnabled by default
aclnnInplaceFillTensorFills value to the selfRef tensor. value is a tensor.Enabled by defaultEnabled by default
aclnnInplaceMaskedFillScalarUses value to fill in the element corresponding to the position whose value istrue in the mask matrix in selfRef.Enabled by defaultEnabled by default
aclnnInplaceMaskedFillTensorUses value to fill in the element corresponding to the position whose value istrue in the mask matrix in selfRef.Enabled by defaultEnabled by default
aclnnInplaceNormalUses 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 defaultEnabled by default
aclnnInplaceNormalTensorUses the normal distributed elements of the mean and std parameters to fill a tensor.Enabled by defaultEnabled by default
aclnnInplaceOneReturns tensors of the same shape and type. All elements are set to 1.Enabled by defaultEnabled by default
aclnnInplaceRandomFills the selfRef tensor with the number sampled from the discrete uniform distribution in the range of [from, to-1].Enabled by defaultEnabled by default
aclnnInplaceRandomTensorFills the selfRef tensor with the number sampled from the discrete uniform distribution in the range of [from, to-1].Enabled by defaultEnabled by default
aclnnInplaceUniformGenerates 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 defaultEnabled by default
aclnnInplaceUniformTensorGenerates random numbers with discrete uniform distribution in the range of [from, to) and fills the random numbers in the selfRef tensor.Enabled by defaultEnabled by default
aclnnInplaceZeroFills the selfRef tensor with all zeros.Enabled by defaultEnabled by default
aclnnIsCloseReturns 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 defaultEnabled by default
aclnnIsFiniteDetermines which elements in a tensor are finite values, that is, not inf, -inf, or nan.Enabled by defaultEnabled by default
aclnnIsInfDetermines which elements in a tensor are infinite values, that is, inf and -inf.Enabled by defaultEnabled by default
aclnnIsInScalarTensorChecks whether elements in element are equal to testElement.Enabled by defaultEnabled by default
aclnnIsInTensorScalarChecks whether elements in element are equal to testElement.Enabled by defaultEnabled by default
aclnnIsNegInfDetermines whether the elements of the input tensor are negative infinity.Enabled by defaultEnabled by default
aclnnIsPosInfDetermines whether the elements of the input tensor are positive infinity.Enabled by defaultEnabled by default
aclnnKlDivCalculates the KL divergence.Enabled by defaultEnabled by default
aclnnLeftShiftShifts 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 defaultEnabled by default
aclnnLeftShiftsShifts each element in the input tensor self to the left bit by bit based on the input scalar shiftBits.Enabled by defaultEnabled by default
aclnnLerp&aclnnInplaceLerpPerforms linear interpolation between the start and end tensors based on the given weight and returns the interpolated tensor.Enabled by defaultEnabled by default
aclnnLerps&aclnnInplaceLerpsPerforms linear interpolation between the start and end tensors based on the given weight and returns the interpolated tensor.Enabled by defaultEnabled by default
aclnnLeScalar&aclnnInplaceLeScalarCompares 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 defaultEnabled by default
aclnnLeTensor&aclnnInplaceLeTensorCompares 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 defaultEnabled by default
aclnnLgammaPerforms the lgamma mathematical operation on each element of the input tensor.Enabled by defaultEnabled by default
aclnnLinalgCholeskyComputes the Cholesky factorization of a real symmetric positive definite matrix.Enabled by default-
aclnnLinalgCrossPerforms the linear_cross operation on the input tensor.Enabled by defaultEnabled by default
aclnnLinalgQrPerforms orthogonal decomposition on the input tensor.Enabled by defaultEnabled by default
aclnnLinspaceGenerates a sequence of equally spaced values.Enabled by defaultEnabled by default
aclnnLog&aclnnInplaceLogComputes natural logarithms.Enabled by defaultEnabled by default
aclnnLog2&aclnnInplaceLog2Computes the logarithm with the base of 2.Enabled by defaultEnabled by default
aclnnLog10&aclnnInplaceLog10Computes the logarithm of the input with base 10.Enabled by defaultEnabled by default
aclnnLog1p&aclnnInplaceLog1pComputes log1p for the input tensor.Enabled by defaultEnabled by default
aclnnLogAddExpComputes the logarithm (base: e) of the power sum of the input tensor.Enabled by defaultEnabled by default
aclnnLogAddExp2Computes the logarithm (base: 2) of the power sum of the input tensor.Enabled by defaultEnabled by default
aclnnLogdetCalculates the natural logarithm of the determinant of the input self.Enabled by defaultEnabled by default
aclnnLogicalAnd&aclnnInplaceLogicalAndComputes 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 defaultEnabled by default
aclnnLogicalNot&aclnnInplaceLogicalNotComputes 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 defaultEnabled by default
aclnnLogicalOr&aclnnInplaceLogicalOrComputes 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 defaultEnabled by default
aclnnLogicalXorCompletes 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 defaultEnabled by default
aclnnLogSpaceCreates a one-dimensional tensor of size steps\text{steps}, whose value is evenly spaced on the logarithmic scale from basestart\text{base}^\text{start} to baseend\text{base}^\text{end}, including endpoints, with base\text{base} as the base.Enabled by defaultEnabled by default
aclnnLogSumExpReturns the log of summed exponents of the input tensor in a given dimension.Enabled by defaultEnabled by default
aclnnLtScalar&aclnnInplaceLtScalarCompares 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 defaultEnabled by default
aclnnLtTensor&aclnnInplaceLtTensorCompares 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 defaultEnabled by default
aclnnMaskedScalePerforms element-wise computation.Enabled by defaultEnabled by default
aclnnMaskedSelectSelects 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 defaultEnabled by default
aclnnMaxReturns the maximum value of all elements in the tensor.Enabled by defaultEnabled by default
aclnnMaxDimReturns the maximum value of the specified dimension of a tensor and the index position of the value.Enabled by defaultEnabled by default
aclnnMaximumComputes the element-wise maximum value of two tensors and returns a new tensor.Enabled by defaultEnabled by default
aclnnMaxNComputes the maximum value of each element in the input tensor list.Enabled by defaultEnabled by default
aclnnMaxV2Computes the maximum element value of an input tensor on a specified dimension.Enabled by defaultEnabled by default
aclnnMeanComputes the mean value of tensors on a specified dimension.Enabled by defaultEnabled by default
aclnnMeanV2Computes the mean value of tensors on a specified dimension.Enabled by defaultEnabled by default
aclnnMinReturns the minimum value of all elements in a tensor.Enabled by defaultEnabled by default
aclnnMinDimReturns the minimum value and index position of the specified dimension in self.Enabled by defaultEnabled by default
aclnnMinimumComputes the element-wise minimum value of two tensors and returns a new tensor.Enabled by defaultEnabled by default
aclnnMinNComputes the minimum value of each element in the input tensor list.Enabled by defaultEnabled by default
aclnnMul&aclnnInplaceMulPerforms multiplication computation between tensors.Enabled by defaultEnabled by default
aclnnMuls&aclnnInplaceMulsPerforms multiplication computation between the tensor and scalar.Enabled by defaultEnabled by default
aclnnMultinomialIn 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 defaultEnabled by default
aclnnMultinomialTensorIn 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 defaultEnabled by default
aclnnNanToNum&aclnnInplaceNanToNumReplaces NaN, positive infinity, and negative infinity in the input with the values specified by nan, posinf, and neginf, respectively.Enabled by defaultEnabled by default
aclnnNeg&aclnnInplaceNegComputes the opposite number of each input element.Enabled by defaultEnabled by default
aclnnNeScalar&aclnnInplaceNeScalarComputes whether the element values in selfRef are equal to those in other.Enabled by defaultEnabled by default
aclnnNeTensor&aclnnInplaceNeTensorComputes whether the element values in self (selfRef) are equal to those in other.Enabled by defaultEnabled by default
aclnnNormalFloatFloatReturns a random number tensor obtained from the independent normal distribution of the given mean (float) and standard deviation (float).-Enabled by default
aclnnNormalFloatTensorReturns a random number tensor obtained from the independent normal distribution of the given mean (float) and standard deviation (tensor).Enabled by defaultEnabled by default
aclnnNormalTensorFloatReturns a random number tensor obtained from the independent normal distribution of the given mean (tensor) and standard deviation (float).Enabled by defaultEnabled by default
aclnnNormalTensorTensorReturns a random number obtained from the independent normal distribution of the given mean (tensor) and standard deviation (tensor).Enabled by defaultEnabled by default
aclnnNpuFormatCastPerforms ND ←→ [NZ] conversion.Enabled by defaultEnabled by default
aclnnOneHotPerforms 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 defaultEnabled by default
aclnnPdistComputes the p-norm distance of each pair of row vectors in the input self.Enabled by default-
aclnnPdistForwardComputes the p-norm distance of each pair of row vectors in the input self.Enabled by default-
aclnnPermuteExchanges 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 defaultEnabled by default
aclnnPolarCalculate 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 defaultEnabled by default
aclnnPowScalarTensorUses each element of exponent as the power of the corresponding element of input to complete the computation.Enabled by defaultEnabled by default
aclnnPowTensorScalar&aclnnInplacePowTensorScalarUses each element of exponent as the power of the corresponding element of input to complete the computation.Enabled by defaultEnabled by default
aclnnPowTensorTensor&aclnnInplacePowTensorTensorUses each element of exponent as the power of the corresponding element of input to complete the computation.Enabled by defaultEnabled by default
aclnnPrecisionCompareChecks 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 defaultEnabled by default
aclnnProdReturns the product of all elements in the input tensor.Enabled by defaultEnabled by default
aclnnProdDimReturns the product of each row in a specified dimension of the input tensor.Enabled by defaultEnabled by default
aclnnQrPerforms orthogonal decomposition on the input tensor.Enabled by default-
aclnnInplaceRandomWithoutFromToGiven 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
aclnnInplaceRandomWithoutFromToTensorGiven 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
aclnnRandpermReturns a random integer ranging from 0 to n-1.Enabled by defaultEnabled by default
aclnnRangeThe value is obtained from start to end based on the step.Enabled by defaultEnabled by default
aclnnRealObtains the real number part of each element of the input tensor.Enabled by defaultEnabled by default
aclnnReciprocal&aclnnInplaceReciprocalReturns a new tensor with the reciprocal of each input element.Enabled by defaultEnabled by default
aclnnReduceLogSumComputes the log sum of the input tensor's elements along the provided axes.Enabled by default-
aclnnReduceNansumReturns the sum of a specified dimension of the input tensor after NaN in the tensor is processed to 0.Enabled by default-
aclnnReduceSumReturns the sum of each row in a specified dimension of the input tensor.Enabled by defaultEnabled by default
aclnnReflectionPad1dPads the input tensor with the reflection of the input boundary.Enabled by defaultEnabled by default
aclnnReflectionPad1dBackwardPerforms backpropagation of reflection_pad1d. For details about the forward propagation, see aclnnReflectionPad1d.Enabled by defaultEnabled by default
aclnnReflectionPad2dPads the input tensor with the reflection of the input boundary.Enabled by defaultEnabled by default
aclnnReflectionPad2dBackwardPerforms backpropagation of reflection_pad2d. For details about the forward propagation, see aclnnReflectionPad2d.Enabled by defaultEnabled by default
aclnnReflectionPad3dPerforms 3D reflection padding.Enabled by defaultEnabled by default
aclnnReflectionPad3dBackwardPerforms backpropagation of aclnnReflectionPad3d.Enabled by defaultEnabled by default
aclnnRemainderScalarTensorAfter 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 defaultEnabled by default
aclnnRemainderTensorScalar&aclnnInplaceRemainderTensorScalarReturns the remainder of each element in tensor self divided by scalar other.Enabled by defaultEnabled by default
aclnnRemainderTensorTensor&aclnnInplaceRemainderTensorTensorAfter 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 defaultEnabled by default
aclnnRepeatRepeats the input tensor for the number of times specified by repeats along each dimension.Enabled by defaultEnabled by default
aclnnReplicationPad1dPads the last dimension of the input tensor using replication of the input boundary.Enabled by defaultEnabled by default
aclnnReplicationPad1dBackwardPerforms backpropagation of replication_pad1d.Enabled by defaultEnabled by default
aclnnReplicationPad2dPads the last two dimensions of the input tensor using replication of the input boundary.Enabled by defaultEnabled by default
aclnnReplicationPad2dBackwardPerforms backpropagation of replication_pad2d. For details about the forward propagation, see aclnnReplicationPad2d.Enabled by defaultEnabled by default
aclnnReplicationPad3dPads the last three dimensions of the input tensor using replication of the input boundary.Enabled by defaultEnabled by default
aclnnReplicationPad3dBackwardPerforms backpropagation of aclnnReplicationPad3d.Enabled by defaultEnabled by default
aclnnRightShiftShifts each element in the input tensor to the right by bit based on the corresponding parameter in the input tensor shiftBits.Enabled by defaultEnabled by default
aclnnRollRolls data in a tensor based on the given size and dimension.Enabled by defaultEnabled by default
aclnnRound&aclnnInplaceRoundRounds the input value to the nearest integer. If the value is equidistant from two integers, round it to the even integer.Enabled by defaultEnabled by default
aclnnRoundDecimals&aclnnInplaceRoundDecimalsRounds the elements of the input tensor to the specified number of decimal places.Enabled by defaultEnabled by default
aclnnRsqrt&aclnnInplaceRsqrtComputes the reciprocal of the square root of each element in the input tensor.Enabled by defaultEnabled by default
aclnnRsubPerforms subtraction.Enabled by defaultEnabled by default
aclnnRsubsPerforms subtraction.Enabled by defaultEnabled by default
aclnnScaleComputes the scale and bias of the input tensor. If bias is not specified, y=x⋅scaley = x \cdot scale is used. If bias is specified, y=x⋅scale+biasy = x \cdot scale + bias is used.Enabled by defaultEnabled by default
aclnnSearchSortedSearches for the position where a given tensor value (self) should be inserted in a sorted tensor (sortedSequence).Enabled by defaultEnabled by default
aclnnSearchSortedsSearches for the position where a given scalar value (self) should be inserted in a sorted one-dimensional tensor (sortedSequence).Enabled by default-
aclnnSignPerforms the sign function on each element of the input tensor and outputs the result tensor.Enabled by defaultEnabled by default
aclnnSignbitChecks whether the sign bit of each element in the input is 1 and returns a tensor.Enabled by defaultEnabled by default
aclnnSignBitsPackPacks one bit of Adam of the float16 or float32 type into uint8.Enabled by default-
aclnnSignBitsUnpackUnpacks 1-bit Adam of the uint8 type into float32 or float16.Enabled by default-
aclnnSilentCheckThe 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-
aclnnSilentCheckV2Whether to trigger a silence detection fault is identified based on the stepRef parameter and the Markov inequality threshold.Enabled by default-
aclnnSimThreadExponentialGenerates an exponentially distributed random number that obeys the lambda parameter and fills it in the selfRef tensor.Enabled by defaultEnabled by default
aclnnSin&aclnnInplaceSinPerforms the sin operation on the input tensor.Enabled by defaultEnabled by default
aclnnSinc&aclnnInplaceSincPerforms the sinc operation on the input tensor.Enabled by defaultEnabled by default
aclnnSinh&aclnnInplaceSinhPerforms the sinh operation on the input tensor.Enabled by defaultEnabled by default
aclnnSinkhornComputes the Sinkhorn distance, which can be used for expert routing in MoE models.Enabled by default-
aclnnSliceExtracts 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 defaultEnabled by default
aclnnSliceV2Extracts the tensor out from the input tensor self based on the specified dimension axes, range [starts, ends], and step steps.Enabled by defaultEnabled by default
aclnnSlogdetCalculates the sign and natural logarithm of the determinant of the input self.Enabled by defaultEnabled by default
aclnnSortSorts elements in the input tensor in ascending or descending order along a specified dimension and returns the corresponding index value.Enabled by defaultEnabled by default
aclnnSplitTensorSplits the input self along the dim axis into equally-sized sections based on the splitSections size.Enabled by defaultEnabled by default
aclnnSplitWithSizeSplits the input self along the dim axis into the size of each element in splitSize.Enabled by defaultEnabled by default
aclnnSqrt&aclnnInplaceSqrtCalculates the square root of a non-negative number. For a negative number, nan is returned.Enabled by defaultEnabled by default
aclnnSquareComputes the square value of each element in the input tensor.Enabled by defaultEnabled by default
aclnnStackStacks tensors along a new axis.Enabled by defaultEnabled by default
aclnnStdComputes the standard deviation of a specified dimension (dim), which can be a single dimension, a dimension list, or None.Enabled by defaultEnabled by default
aclnnStdMeanCorrectionComputes the standard deviation and mean of the sample.Enabled by defaultEnabled by default
aclnnStridedSliceExtracts a sub tensor from the input tensor based on the specified start position, end position, and step.-Enabled by default
aclnnStridedSliceAssignV2StridedSliceAssign 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-
aclnnStridedSliceGradReverse 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&aclnnInplaceSubThe subtraction computation is complete, and the subtracted number is scaled by alpha.Enabled by defaultEnabled by default
aclnnSubs&aclnnInplaceSubsThe subtraction computation is complete, and the subtracted number is scaled by alpha.Enabled by defaultEnabled by default
aclnnSumReturns the sum of each input tensor in the input tensors list.Enabled by default-
aclnnSvdComputes singular value decomposition of one or more matrices.Enabled by defaultEnabled by default
aclnnSWhereSelects elements from self or other based on the condition and returns the elements (broadcasting is supported).Enabled by defaultEnabled by default
aclnnTan&aclnnInplaceTanComputes the tangent of each element in the input tensor self and stores the result in the output tensor out.Enabled by defaultEnabled by default
aclnnTanh&aclnnInplaceTanhActivation function Returns a tensor with the same shape as the input tensor. Performs elementwise computation on the input tensor.Enabled by defaultEnabled by default
aclnnTanhBackwardPerforms backpropagation of aclnnTanh.Enabled by defaultEnabled by default
aclnnTopkReturns the k extremum values and indexes of the input tensor in the specified dimension.Enabled by defaultEnabled by default
aclnnTraceCalculates the sum of the main diagonal elements of a matrix starting from the upper left corner.Enabled by default-
aclnnTransformBiasRescaleQkvThe TransformBiasRescaleQkv operator is an API used to process the query, key, and value vectors in the multi-head attention mechanism.Enabled by defaultEnabled by default
aclnnTransConvolutionWeightCreates a weight tensor for computation performance affinity of the Convolution operator. This API must be used in conjunction with aclnnCalculateConvolutionWeightSize.Enabled by default-
aclnnTransMatmulWeightCreates a weight tensor for computation performance affinity of the Matmul operator. This API must be used in conjunction with aclnnCalculateMatmulWeightSize and aclnnCalculateMatmulWeightSizeV2.Enabled by defaultEnabled by default
aclnnTriangularSolveSolves a system of equations with a square upper or lower triangular invertible matrix A and multiple right-hand sides b.Enabled by defaultEnabled by default
aclnnTril&aclnnInplaceTrilZeros 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 defaultEnabled by default
aclnnTriu&aclnnInplaceTriuZeros 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 defaultEnabled by default
aclnnTrunc&aclnnInplaceTruncPerforms the truncation operation on the input tensor, that is, truncates the decimal part of a number and returns the integer part.Enabled by defaultEnabled by default
aclnnUnfoldGradPerforms backpropagation of the Unfold operator and computes its gradient.Enabled by defaultEnabled by default
aclnnVarReturns the variance over the value of the specified dimension of the input tensor.Enabled by defaultEnabled by default
aclnnVarCorrectionReturns the variance over the value of the specified dimension of the input tensor.Enabled by defaultEnabled by default
aclnnVarMeanReturns the mean and variance of the dimension specified by the input tensor.Enabled by defaultEnabled by default
aclnnWeightQuantPreprocessPreprocess the parameters of the fake-quantization Matmul.-Enabled by default
aclnnXlog1pyCalculates x * log(1 + y). If x = = 0, the result is 0. Broadcast is supported.Enabled by defaultEnabled by default
aclnnAmpUpdateScaleImplements the dynamic scale update logic in AMP training.Enabled by defaultEnabled by default
aclnnXLogYScalarOther&aclnnInplaceXLogYScalarOtherComputes the result of self * log(other).Enabled by default-
aclnnXLogYScalarSelfComputes the result of self * log(other).Enabled by default-
aclnnXLogYTensor&aclnnInplaceXLogYTensorComputes the result of self * log(other).Enabled by default-
aclRfft1DPerforms Real Fast Fourier Transform (RFFT) on the input tensor self, and outputs a complex tensor containing non-negative frequencies.Enabled by default-
aclStftComputes the Fourier transform of the input in a sliding window.Enabled by defaultEnabled by default