mindspore.ops
mindspore.ops provides a large number of function interfaces, including neural network functions, mathematical operation functions, Tensor operation functions, Parameter operation functions, differential functions and so on.
For more information about dynamic shape support status, please refer to Dynamic Shape Support Status of ops Interface .
The module import method is as follows:
from mindspore import ops
Compared with the previous version, the added, deleted and supported platforms change information of mindspore.ops operators in MindSpore, please refer to the link mindspore.ops API Interface Change.
Neural Network Layer Functions
Neural Network
API Name |
Description |
Supported Platforms |
Warning |
Applies a 1D adaptive average pooling over an input Tensor which can be regarded as a composition of 1D input planes. |
|
None |
|
Performs 2D adaptive average pooling on a multi-plane input signal. |
|
This is an experimental API that is subject to change or deletion. |
|
Performs 3D adaptive average pooling on a multi-plane input signal. |
|
None |
|
Applies a 1D adaptive maximum pooling over an input Tensor which can be regarded as a composition of 1D input planes. |
|
None |
|
This operator applies a 2D adaptive max pooling to an input signal composed of multiple input planes. |
|
None |
|
Applies a 1D average pooling over an input Tensor which can be regarded as a composition of 1D input planes. |
|
kernel_size is in the range [1, 255]. stride is in the range [1, 63]. |
|
Applies a 2D average pooling over an input Tensor which can be regarded as a composition of 2D input planes. |
|
kernel_size is in the range [1, 255]. stride is in the range [1, 63]. |
|
Applies a 3D average pooling over an input Tensor which can be regarded as a composition of 3D input planes. |
|
kernel_size is in the range [1, 255]. stride is in the range [1, 63]. |
|
Batch Normalization for input data and updated parameters. |
|
For Atlas 200/300/500 inference product, the result accuracy fails to reach 1‰ due to the square root instruction. |
|
Returns the sum of the input_x and the bias Tensor. |
|
None |
|
Applies bilinear dense connected layer for input1 and input2. |
|
This is an experimental API that is subject to change or deletion. |
|
Performs greedy decoding on the logits given in inputs. |
|
None |
|
Applies a 1D convolution over an input tensor. |
|
None |
|
Applies a 2D convolution over an input tensor. |
|
None |
|
Applies a 3D convolution over an input tensor. |
|
None |
|
Given 4D tensor inputs x, weight and offsets, compute a 2D deformable convolution. |
|
This is an experimental API that is subject to change or deletion. |
|
Applies the dense connected operation to the input. |
|
This is an experimental API that is subject to change or deletion. On the Ascend platform, if bias is not 1D, the input cannot be greater than 6D in PYNATIVE or KBK mode. |
|
During training, randomly zeroes some of the elements of the input tensor with probability p from a Bernoulli distribution. |
|
The Ascend backend does not support the reproducibility of random numbers, so the seed parameter has no effect. |
|
During training, randomly zeroes some channels of the input tensor with probability p from a Bernoulli distribution(For a 3-dimensional tensor with a shape of |
|
None |
|
During training, randomly zeroes some channels of the input tensor with probability p from a Bernoulli distribution(For a 4-dimensional tensor with a shape of |
|
None |
|
During training, randomly zeroes some channels of the input tensor with probability p from a Bernoulli distribution(For a 5-dimensional tensor with a shape of |
|
None |
|
Retrieve the word embeddings in weight using indices specified in input. |
|
On Ascend, the behavior is unpredictable when the value of input is invalid. |
|
Flatten a tensor along dimensions from start_dim to start_dim. |
|
None |
|
Combines an array of sliding local blocks into a large containing tensor. |
|
The input must be a 3-dimensional Tensor with shape |
|
Applies the 3D FractionalMaxPool operation over input. |
|
This is an experimental API that is subject to change or deletion. |
|
This is a FlashAttention function designed for both incremental and full inference scenarios. |
|
This is an experimental API that is subject to change or deletion. For Ascend, only the Atlas A2 training series products and Atlas 800I A2 inference products are currently supported. |
|
The interface is used for self-attention fusion computing. |
|
This is an experimental API that is subject to change or deletion. Only support on Atlas A2 training series. |
|
Group Normalization over a mini-batch of inputs. |
|
None |
|
Applies the Layer Normalization on the mini-batch input. |
|
None |
|
Applying 1D LPPooling operation on an input Tensor can be regarded as forming a 1D input plane. |
|
None |
|
Applying 2D LPPooling operation on an input Tensor can be regarded as forming a 2D input plane. |
|
None |
|
Local Response Normalization. |
|
lrn is deprecated on Ascend due to potential accuracy problem. It's recommended to use other normalization methods, e.g. |
|
Performs a 2D max pooling on the input Tensor. |
|
None |
|
Performs a 3D max pooling on the input Tensor. |
|
None |
|
Computes the inverse of max_pool1d. |
|
None |
|
Computes the inverse of max_pool2d. |
|
None |
|
Computes the inverse of |
|
None |
|
Permute the tokens based on the indices. |
|
It is only supported on Atlas A2 Training Series Products. The input tokens only supports the bfloat16 data type in the current version. When indices is 2-D, the size of the second dim must be less than or equal to 512. |
|
Unpermute a tensor of permuted tokens based on sorted indices, and optionally merge the tokens with their corresponding probabilities. |
|
It is only supported on Atlas A2 Training Series Products. The inputs permuted_tokens and probs only support the bfloat16 data type in the current version. sorted_indices must not have duplicate values, otherwise the result is undefined. |
|
The interface for incremental inference. |
|
Only support on Atlas A2 training series. |
|
The interface for fully inference. |
|
Support dtype of float16 for attn_mask will be deprecated in the future. When sparse_mode is 2, 3 or 4, the shape of attn_mask must be |
|
Implement self-attention calculations in training scenarios. |
|
This is an experimental API that is subject to change or deletion. Only support on Atlas A2 training series. |
|
The RmsNorm(Root Mean Square Layer Normalization) operator is a normalization operation. |
|
This is an experimental API that is subject to change or deletion. This API is only supported in Atlas A2 training series for now. |
|
Extracts sliding local blocks from a batched input tensor. |
|
The output is a 3-dimensional Tensor whose shape is |
Loss Functions
API Name |
Description |
Supported Platforms |
Warning |
Computes the binary cross entropy(Measure the difference information between two probability distributions) between predictive value logits and target value labels. |
|
The value of logits must range from 0 to l. |
|
Adds sigmoid activation function to input input as logits, and uses the given logits to compute binary cross entropy between the input and the target. |
|
None |
|
CosineEmbeddingLoss creates a criterion to measure the similarity between two tensors using cosine distance. |
|
None |
|
The cross entropy loss between input and target. |
|
None |
|
Calculates the CTC (Connectionist Temporal Classification) loss and the gradient. |
|
None |
|
Gaussian negative log likelihood loss. |
|
None |
|
Measures Hinge Embedding Loss given an input Tensor intputs and a labels Tensor targets (containing 1 or -1). |
|
None |
|
Calculates the error between the predicted value and the target value, which has the best of both the loss of |
|
None |
|
Computes the Kullback-Leibler divergence between the logits and the labels. |
|
None |
|
Calculate the mean absolute error between the input value and the target value. |
|
None |
|
MarginRankingLoss creates a criterion that measures the loss. |
|
None |
|
Calculates the mean squared error between the predicted value and the label value. |
|
None |
|
Hinge loss for optimizing a multi-class classification. |
|
None |
|
Hinge loss for optimizing a multi-label classification. |
|
None |
|
Calculates the MultiLabelSoftMarginLoss. |
|
None |
|
Gets the negative log likelihood loss between inputs and target. |
|
None |
|
Computes smooth L1 loss, a robust L1 loss. |
|
This API has poor performance on CPU and it is recommended to run it on the Ascend/GPU. |
|
Calculate the soft margin loss of input and target. |
|
This is an experimental API that is subject to change or deletion. |
|
TripletMarginLoss operation. |
|
None |
Activation Functions
API Name |
Description |
Supported Platforms |
Warning |
celu activation function, computes celu (Continuously differentiable exponential linear units) of input tensors element-wise. |
|
This is an experimental API that is subject to change or deletion. |
|
Exponential Linear Unit activation function. |
|
None |
|
Fast Gaussian Error Linear Units activation function. |
|
None |
|
Gaussian Error Linear Units activation function. |
|
None |
|
Computes GLU (Gated Linear Unit activation function) of input tensors. |
|
None |
|
Returns the samples from the Gumbel-Softmax distribution and optionally discretizes. |
|
None |
|
Hard Shrink activation function. |
|
None |
|
Hard Sigmoid activation function. |
|
None |
|
Hard Swish activation function. |
|
None |
|
Applies the hardtanh activation function element-wise. |
|
None |
|
leaky_relu activation function. |
|
None |
|
Applies the Log Softmax function to the input tensor on the specified axis. |
|
None |
|
Applies LogSigmoid activation element-wise. |
|
None |
|
Computes MISH(A Self Regularized Non-Monotonic Neural Activation Function) of input tensors element-wise. |
|
None |
|
Parametric Rectified Linear Unit activation function. |
|
None |
|
Computes ReLU (Rectified Linear Unit activation function) of input tensors element-wise. |
|
None |
|
Computes ReLU (Rectified Linear Unit) upper bounded by 6 of input tensors element-wise. |
|
None |
|
Randomized Leaky ReLU activation function. |
|
None |
|
Activation function SeLU (Scaled exponential Linear Unit). |
|
None |
|
Computes Sigmoid of input element-wise. |
|
None |
|
Computes Sigmoid Linear Unit of input element-wise, also known as Swish function. |
|
None |
|
Applies the Softmax operation to the input tensor on the specified axis. |
|
None |
|
Applies the Softmin operation to the input tensor on the specified axis. |
|
None |
|
Soft Shrink activation function. |
|
None |
|
SoftSign activation function. |
|
None |
|
Computes SwiGLU (Swish-Gated Linear Unit activation function) of input tensor. |
|
This is an experimental API that is subject to change or deletion. |
|
Computes hyperbolic tangent of input element-wise. |
|
None |
|
Returns each element of input after thresholding by thr as a Tensor. |
|
None |
Distance Functions
API Name |
Description |
Supported Platforms |
Warning |
Computes p-norm distance between each pair of row vectors of two input Tensors. |
|
None |
|
Computes batched the |
|
None |
|
Calculates the distance between every pair of row vectors in the input using the p-norm. |
|
None |
Sampling Functions
API Name |
Description |
Supported Platforms |
Warning |
Generates a random sample as index tensor with a mask tensor from a given tensor. |
|
The Ascend backend does not support the reproducibility of random numbers, so the seed parameter has no effect. |
|
Generates random samples from a given categorical distribution tensor. |
|
The Ascend backend does not support the reproducibility of random numbers, so the seed parameter has no effect. |
|
Generates random labels with a log-uniform distribution for sampled_candidates. |
|
The Ascend backend does not support the reproducibility of random numbers, so the seed parameter has no effect. |
|
Uniform candidate sampler. |
|
The Ascend backend does not support the reproducibility of random numbers, so the seed parameter has no effect. The Ascend backend does not support dynamic shape scenarios currently. |
Image Functions
API Name |
Description |
Supported Platforms |
Warning |
Returns a 2D or 3D flow field (sampling grid) based on theta, a batch of affine matrices. |
|
None |
|
Decode the bounding box locations, calculate the offset, and convert the offset into a Bbox, which is used to mark the target in the subsequent images, etc. |
|
None |
|
Encode the bounding box locations, calculate the offset between the predicted bounding boxes and the real bounding boxes, and the offset will be used as a variable for the loss. |
|
None |
|
Combines an array of sliding local blocks into a large containing tensor. |
|
None |
|
Checks whether the bounding box is in the image. |
|
The bounding box specified by bboxes and the image information specified by img_metas need to be valid, i.e.: |
|
Extracts crops from the input image Tensor and resizes them. |
|
None |
|
Given an input and a flow-field grid, computes the output using input values and pixel locations from grid. |
|
None |
|
Samples the input Tensor to the given size or scale_factor by using one of the interpolate algorithms. |
|
None |
|
Calculates intersection over union for boxes. |
|
In Ascend, only computation of float16 data is supported. To avoid overflow, the input length and width are scaled by 0.2 internally. |
|
Pads the input tensor according to the padding. |
|
None |
|
Extends the last dimension of the input tensor from 1 to pad_dim_size, by filling with 0. |
|
None |
|
Applies the PixelShuffle operation over input input which implements sub-pixel convolutions with stride |
|
None |
|
Applies the PixelUnshuffle operation over input input which is the inverse of PixelShuffle. |
|
None |
|
Implements the Rotary Position Embedding algorithm. |
|
This is an experimental API that is subject to change or deletion. |
|
Calculate the overlap area between rotated rectangles. |
|
This is an experimental API that is subject to change or deletion. |
|
Alias for |
|
None |
Mathematical Functions
Element-wise Operations
API Name |
Description |
Supported Platforms |
Warning |
Compute the absolute value of a tensor element-wise. |
|
None |
|
Alias for |
|
None |
|
Return the element-wise sum of all input tensors. |
|
None |
|
Compute arccosine of each element in input tensors. |
|
None |
|
Alias for |
|
None |
|
Computes inverse hyperbolic cosine of each element in inputs tensors. |
|
None |
|
Compute the element-wise sum of the two input tensors. |
|
None |
|
Divide tensor1 by tensor2 element-wise, multiply the result by the scalar value , and add it to input . |
|
None |
|
Multiply tensor1 by tensor2 element-wise, scale the result by the scalar value , and add it to input . |
|
None |
|
Multiply the matrix mat and vector vec , and then add the result to the input . |
|
None |
|
Return the element-wise sum of all input tensors. |
|
None |
|
Returns the element-wise angle of the given complex tensor. |
Ascend`` |
None |
|
Alias for |
|
None |
|
Alias for |
|
None |
|
Alias for |
|
None |
|
Alias for |
|
None |
|
Alias for |
|
None |
|
Alias for |
|
None |
|
Computes arcsine of input tensors element-wise. |
|
None |
|
Computes inverse hyperbolic sine of the input element-wise. |
|
None |
|
Computes the trigonometric inverse tangent of the input element-wise. |
|
None |
|
Returns arctangent of input/other element-wise. |
|
None |
|
Computes inverse hyperbolic tangent of the input element-wise. |
|
None |
|
Returns a one-dimensional tensor of each zero-dimensional tensor, while tensors with one or more dimensions remain unchanged. |
|
None |
|
Returns a 2-dimensional tensor of each tensor, while tensors with two or more dimensions remain unchanged. |
|
None |
|
Returns a 3-dimensional tensor of each tensor, while tensors with three or more dimensions remain unchanged. |
|
None |
|
Computes the zeroth order modified Bessel function of the first kind for each element input. |
|
None |
|
Computes the exponentially scaled zeroth order modified Bessel function of the first kind for each element input. |
|
None |
|
Computes the first order modified Bessel function of the first kind for each element input. |
|
None |
|
Computes the exponentially scaled first order modified Bessel function of the first kind for each element input. |
|
None |
|
Computes the zeroth order Bessel function of the first kind for each element input. |
|
None |
|
Computes the first order Bessel function of the first kind for each element input. |
|
None |
|
Computes the zeroth order modified Bessel function of the second kind for each element input. |
|
None |
|
Computes the exponentially scaled zeroth order modified Bessel function of the second kind for each element input. |
|
None |
|
Computes the first order modified Bessel function of the second kind for each element input. |
|
None |
|
Computes the exponentially scaled first order modified Bessel function of the second kind for each element input. |
|
None |
|
Computes the zeroth order Bessel function of the second kind for each element input. |
|
None |
|
Computes the first order Bessel function of the second kind for each element input. |
|
None |
|
Compute the bitwise AND of two input tensors. |
|
None |
|
Perform a left bitwise shift operation on the input element-wise, where the number of bits to shift is specified by other. |
|
None |
|
Compute the bitwise OR of two input tensors. |
|
None |
|
Perform a right bitwise shift operation on the input element-wise, where the number of bits to shift is specified by other. |
|
None |
|
Compute the bitwise XOR of two input tensors. |
|
None |
|
Rounds a tensor up to the closest integer element-wise. |
|
None |
|
Clamp all elements of the input tensor within the range [min, max]. |
|
None |
|
Alias for |
|
None |
|
Return all r-length subsequences of input tensor. |
|
None |
|
Create a float tensor composed of the absolute values of x and the signs of other . |
|
None |
|
Computes cosine of input element-wise. |
|
Using float64 may cause a problem of missing precision. |
|
Computes hyperbolic cosine of input element-wise. |
|
None |
|
Calculate cosine similarity between two input tensors along the specified dimension. |
|
None |
|
Return the covariance matrix of the input tensor, where the rows of the input tensor represent variables and the columns represent observations. |
|
The values of fweights and aweights cannot be negative, and the negative weight scene result is undefined. |
|
Create a tensor whose diagonals of certain 2D planes (specified by dim1 and dim2) are filled by input, and all other positions are set to |
|
None |
|
Computes the n-th forward difference along the given axis. |
|
None |
|
Convert angles from degrees to radians element-wise. |
|
None |
|
Computes the logarithmic derivative of the gamma function on input tensor. |
|
This is an experimental API that is subject to change or deletion. |
|
Divide the first input tensor by the second input tensor in floating-point type element-wise. |
|
None |
|
Alias for |
|
None |
|
Compute the Gauss error of input tensor element-wise. |
|
None |
|
Compute the complementary error function of input tensor element-wise. |
|
None |
|
Compute the inverse error of input tensor element-wise. |
|
None |
|
Compute exponential of the input tensor element-wise. |
|
None |
|
Compute base two exponential of the input tensor element-wise. |
|
None |
|
Compute exponential of the input tensor, then minus 1, element-wise. |
Ascend`` |
None |
|
Rounds a tensor down to the closest integer element-wise. |
|
None |
|
Alias for |
|
None |
|
Compute element-wise division of input by other and floor the result. |
|
This is an experimental API that is subject to change or deletion. |
|
Compute the remainder of element-wise flooring division of first input by second input. |
|
Data of input y should not be 0, or the maximum value of its dtype will be returned. When the elements of input exceed 2048, the accuracy of operator cannot guarantee the requirement of double thousandths in the mini form. Due to different architectures, the calculation results of this operator on NPU and CPU may be inconsistent. If shape is expressed as |
|
Computes the first input to the power of the second input. |
|
None |
|
Compute the remainder of element-wise division of first input by the second input. |
|
None |
|
Return the fractional part of each element in the input tensor. |
|
None |
|
Computes greatest common divisor of input tensors element-wise. |
|
This is an experimental API that is subject to change or deletion. |
|
Given the legs of a right triangle, return its hypotenuse, element-wise. |
|
None |
|
Calculates lower regularized incomplete Gamma function. |
|
This is an experimental API that is subject to change or deletion. |
|
Calculates upper regularized incomplete Gamma function. |
|
This is an experimental API that is subject to change or deletion. |
|
Return a new tensor containing imaginary value of the input tensor, element-wise. |
|
None |
|
For details, please refer to |
|
None |
|
Computes Reciprocal of input tensor element-wise. |
|
None |
|
Flip all bits of input tensor element-wise. |
|
None |
|
Computes least common multiplier of input tensors element-wise. |
|
None |
|
Multiplies input tensor by |
|
None |
|
Does a linear interpolation of two tensors input and end based on a float or tensor weight. |
|
None |
|
Compute the natural logarithm of the input tensor element-wise. |
|
If the input value of operator Log is within the range (0, 0.01] or [0.95, 1.05], the output accuracy may be affacted. |
|
Compute the logarithm to the base 2 of the input tensor element-wise. |
|
If the input value of operator log2 is within the range (0, 0.01] or [0.95, 1.05], the output accuracy may be affected. |
|
Compute the logarithm to the base 10 of the input tensor element-wise. |
|
If the input value of operator log10 is within the range (0, 0.01] or [0.95, 1.05], the output accuracy may be affected. |
|
Compute the natural logarithm of (tensor + 1) element-wise. |
|
None |
|
Computes the logarithm of the sum of exponentiations of the inputs. |
|
None |
|
Computes the logarithm of the sum of exponentiations in base of 2 of the inputs. |
|
None |
|
Compute the "logical AND" of two tensors element-wise. |
|
None |
|
Compute the "logical NOT" of the input tensor element-wise. |
|
None |
|
Compute the "logical OR" of two tensors element-wise. |
|
None |
|
Compute the "logical XOR" of two tensors element-wise. |
|
None |
|
Calculate the logit of a tensor element-wise. |
|
None |
|
Multiplies two tensors element-wise. |
|
None |
|
Alias for |
|
None |
|
Compute the multivariate log-gamma function with dimension p element-wise. |
|
None |
|
Returns a tensor with negative values of the input tensor element-wise. |
|
None |
|
Alias for |
|
None |
|
Returns the next representable floating-point value after input towards other element-wise. |
|
None |
|
Converts polar coordinates to Cartesian coordinates. |
|
None |
|
Computes the |
|
None |
|
Return self tensor. |
|
None |
|
Calculate the exponent power of each element in input. |
|
None |
|
Converts angles in radians to angles in degrees element-wise. |
|
None |
|
Expand the multidimensional Tensor into 1D along the 0 axis direction. |
|
None |
|
Return a tensor that is the real part of the input. |
|
None |
|
Returns reciprocal of a tensor element-wise. |
|
None |
|
Compute the remainder of division for the input tensor element-wise. |
|
When the elements of input exceed 2048, there might be accuracy problems. The calculation results of this operator on Ascend and CPU might be inconsistent. If shape is expressed as (D1,D2... ,Dn), then D1*D2... *DN<=1000000,n<=8. |
|
Rotate a n-D tensor by 90 degrees in the plane specified by dims axis. |
|
None |
|
Round elements of input to the nearest integer. |
|
None |
|
Compute reciprocal of square root of input tensor element-wise. |
|
None |
|
Extension of |
|
None |
|
Return an element-wise indication of the sign of a number. |
|
None |
|
Determine the symbol of each element. |
|
None |
|
Compute sine of the input tensor element-wise. |
|
None |
|
Compute the normalized sinc of input. |
|
None |
|
Compute hyperbolic sine of the input element-wise. |
|
None |
|
Return sqrt of a tensor element-wise. |
|
None |
|
Return square of a tensor element-wise. |
|
None |
|
Subtract the second input from the first input element-wise. |
|
None |
|
Subtract other scaled by alpha from input. |
|
None |
|
Transpose a 2-D tensor. |
|
None |
|
Computes tangent of input element-wise. |
|
None |
|
Apply the element-wise Tanhshrink function. |
|
None |
|
Compute the trapezoidal rule along dim. |
|
None |
|
Return a 2-by-N tensor containing the indices of the lower triangular elements of a row * col matrix. |
|
None |
|
Return a 2-by-N tensor containing the indices of the upper triangular elements of a row * col matrix. |
|
None |
|
Alias for |
|
None |
|
Returns a tensor with the truncated integer values of the elements of the input tensor. |
|
None |
|
Divide the first input tensor x by the second input tensor y element-wise and rounds the results of division towards zero. |
|
None |
|
Return the remainder of division element-wise. |
|
The input data does not support 0. When the elements of input exceed 2048 , the accuracy of operator cannot guarantee the requirement of double thousandths in the mini form. Due to different architectures, the calculation results of this operator on NPU and CPU may be inconsistent. If shape is expressed as (D1,D2... ,Dn), then D1*D2... *DN<=1000000,n<=8. |
|
Divides the first input tensor by the second input tensor element-wise. |
|
None |
|
Computes the first input tensor multiplied by the logarithm of second input tensor element-wise. |
|
On Ascend, the data type of input and other must be float16 or float32. |
|
Elemental-wise compute the Hurwitz zeta output. |
|
This is an experimental API that is subject to change or deletion. |
Reduction Functions
API Name |
Description |
Supported Platforms |
Warning |
Tests if all element in input evaluates to True along the given axes. |
|
None |
|
Return the maximum values along the given axis of the tensor. |
|
None |
|
Return the minimum values along the given axis of the tensor. |
|
None |
|
Return the minimum values and maximum values along the given axes of the tensor. |
|
None |
|
Tests if any element in input evaluates to True along the given axes. |
|
None |
|
Return the indices of the maximum values along a specified dimension of the tensor. |
|
None |
|
Return the indices of the minimum values along a specified dimension of the tensor. |
|
None |
|
Return the cumulative maximum values and their indices along the given axis of the tensor. |
|
None |
|
Return the cumulative minimum values and their indices along the given axis of the tensor. |
|
None |
|
Return the cumulative product along the given dimension of the tensor. |
|
None |
|
Return the cumulative sum along the given axis of the tensor. |
|
None |
|
Computes the maximum of input tensors element-wise. |
|
None |
|
Computes the histogram of a tensor. |
|
None |
|
Calculate the log of cumulative summed exponentials of the tensor along a specified dimension. |
|
This is an experimental API that is subject to change or deletion. |
|
Calculate the log of summed exponentials of the tensor along a specified dimension. |
|
None |
|
Return the maximum values and their indices along the given axis of the tensor. |
|
None |
|
Compute the mean(s) of the tensor along the specified axis(axes). |
|
None |
|
Return the median(s) and indice(s) of the tensor along the specified axis. |
|
indices does not necessarily contain the first occurrence of each median value found in the input, unless it is unique. The specific implementation of this API is device-specific. The results may be different on CPU and GPU. |
|
Return the minimum values and their indices along the given axis of the tensor. |
|
None |
|
Compute the matrix norm or vector norm of the tensor along a specified dimension. |
|
None |
|
Return the product(s) of the tensor along the specified axis(axes). |
|
None |
|
Compute the standard deviation of the tensor along a specified axis. |
|
None |
|
Compute the standard deviation and the mean of the tensor along a specified axis. |
|
None |
|
Compute the variance of the tensor along a specified axis. |
|
None |
|
Compute the variance and the mean of the tensor along a specified axis. |
|
None |
Comparison Functions
API Name |
Description |
Supported Platforms |
Warning |
Return the indices that sort the tensor along the specified axis. |
|
None |
|
Return a boolean tensor where two tensors are element-wise equal within a tolerance. |
|
None |
|
Return the indices of the buckets to which each element in the input tensor belongs. |
|
None |
|
Compute the equivalence of the two inputs element-wise. |
|
None |
|
Compute the equivalence of the two inputs element-wise. |
|
None |
|
Compute the value of |
|
None |
|
Compute the value of |
|
None |
|
Compute the value of |
|
None |
|
Compute the value of |
|
None |
|
Return whether the elements in second input tensor exist among the top k elements of the first input tensor. |
|
None |
|
Return a boolean tensor where two tensors are element-wise equal within a tolerance. |
|
None |
|
Return a boolean tensor indicating which elements are finite. |
|
None |
|
Return a boolean tensor indicating which elements are +/- inifnity. |
|
This is an experimental API that is subject to change. For Ascend, it is only supported on platforms above Atlas A2. |
|
Return a boolean tensor indicating which elements are NaN. |
|
None |
|
Return a boolean tensor indicating which elements are negative infinity. |
|
For Ascend, it is only supported on platforms above Atlas A2. |
|
Return a boolean tensor indicating which elements are positive infinity. |
|
For Ascend, it is only supported on platforms above Atlas A2. |
|
Return a boolean tensor indicating which elements are real. |
|
None |
|
Return a boolean tensor indicating which elements are complex. |
|
None |
|
If the data type of the tensor is a floating point data type, return True. |
|
None |
|
Compute the value of |
|
None |
|
Compute the value of |
|
None |
|
Compute the value of |
|
None |
|
Alias for |
|
None |
|
Compute the maximum of the two input tensors element-wise. |
|
If all inputs are scalar of integers. In Graph mode, the output will be Tensor of int32, while in PyNative mode, the output will be Tensor of int64. |
|
Compute the minimum of the two input tensors element-wise. |
|
None |
|
Return a tensor obtained by sorting the input tensor in ascending order along its first dimension. |
|
None |
|
Compute the non-equivalence of two inputs element-wise. |
|
None |
|
Alias for |
|
None |
|
Return the position indices where the elements can be inserted into the input tensor to maintain the increasing order of the input tensor. |
|
None |
|
Return the top k largest or smallest elements of the input tensor along a specified dimension. |
|
If sorted is set to False, it will use the aicpu operator, the performance may be reduced. In addition, due to different memory layout and traversal methods on different platforms, the display order of calculation results may be inconsistent when sorted is False. |
Linear Algebraic Functions
API Name |
Description |
Supported Platforms |
Warning |
Applies batch matrix multiplication to batch1 and batch2, with a reduced add step and add input to the result. |
|
None |
|
Multiplies matrix mat1 and matrix mat2. |
|
None |
|
Computes the outer product of two vector vec1 and vec2, and adds the resulting matrix to x. |
|
None |
|
Calculates the conjugation of Tensor element by element, and transposes the last two dimensions. |
|
None |
|
The result is the sum of the input and a batch matrix-matrix product of matrices in batch1 and batch2. |
|
None |
|
Computation of batch dot product between samples in two tensors containing batch dims, i.e. x1 or x2 's first dimension is batch size. |
|
None |
|
Computes matrix multiplication between two tensors by batch. |
|
None |
|
Return the Cholesky decomposition of zero or more batch dimensions consisting of symmetric positive-definite matrices. |
|
None |
|
Computes the solution of a set of linear equations with a positive definite matrix, according to its Cholesky decomposition factor input2 . |
|
This is an experimental API that is subject to change or deletion. |
|
Return the matrix norm or vector norm of a given tensor. |
|
None |
|
Computation a dot product between samples in two tensors. |
|
None |
|
Compute the eigenvalues of a square matrix. |
|
This is an experimental API that is subject to change or deletion. |
|
Perform a QR decomposition on the input tensor |
|
This is an experimental API that is subject to change or deletion. |
|
Calculate the outer product of two arrays input and vec2. |
|
None |
|
Return the dot product of two 1-D tensors. |
|
None |
|
Compute the inverse of the input matrix. |
|
None |
|
Compute the Kronecker product of two tensors. |
|
None |
|
Calculate log determinant of one or a batch of square matrices. |
|
None |
|
Compute the solution to a system of linear equations |
|
This is an experimental API that is subject to change or deletion. |
|
Unpack the LU decomposition returned by |
|
None |
|
Return the matrix product of two tensors. |
|
None |
|
Copy a tensor setting everything outside a central band in each innermost matrix to zero. |
|
This is an experimental API that is subject to change or deletion. |
|
Solves systems of linear equations. |
|
On GPU, if the matrix is irreversible, an error may be reported or an unknown result may be returned. |
|
Copy a tensor setting everything outside a central band in each innermost matrix to zero. |
|
This is an experimental API that is subject to change or deletion. |
|
Return a tensor with the contents in x as k[0]-th to k[1]-th diagonals of a matrix, with everything else padded with padding_value . |
|
None |
|
Return a tensor that retains the values of the specified diagonal while setting all other elements to zero. |
|
None |
|
Return a tensor by replacing the elements on the k[0]-th to k[1]-th diagonals of the matrix x with the values from the input diagonal . |
|
None |
|
Returns the matrix product of two arrays. |
|
None |
|
Multiplies matrix mat and vector vec. |
|
None |
|
Compute outer product of two tensors. |
|
None |
|
Calculates the product of a matrix other and a matrix Q (represented by Householder vectors input and Householder reflection coefficients tau). |
|
None |
|
Compute the first |
|
None |
|
Calculates the product of a matrix other and a matrix Q (represented by Householder vectors input and Householder reflection coefficients tau). |
|
None |
|
Computes the (Moore-Penrose) pseudo-inverse of a matrix. |
|
None |
|
Computes the singular value decompositions of one or more matrices. |
|
None |
|
Computes the sign and the log of the absolute value of the determinant of one or more square matrices. |
|
None |
|
Return the sum of the elements along the diagonal of the input tensor. |
|
None |
|
Compute the tensor dot product along the specified axes. |
|
None |
|
Generates a Vandermonde matrix. |
|
None |
|
Calculates the dot product of two batches of vectors along the specified dimension. |
|
This is an experimental API that is subject to change or deletion. |
Spectral Functions
API Name |
Description |
Supported Platforms |
Warning |
Bartlett window function. |
|
None |
|
Blackman window function. |
|
None |
|
Hamming window function. |
|
None |
|
Hann window function. |
|
None |
|
Kaiser window function. |
|
None |
Tensor Operation Functions
Tensor Creation
API Name |
Description |
Supported Platforms |
Warning |
Create a tensor with the same data type and shape as input, and the element value is the minimum value that the corresponding data type can express. |
|
None |
|
Returns a tensor with ones on the diagonal and zeros in the rest. |
|
None |
|
Create a tensor filled with a specified value. |
|
None |
|
Create a tensor filled with a specified value. |
|
None |
|
Return a tensor of the same shape as input and filled with a specified value. |
|
None |
|
Generate a one-dimensional tensor with steps elements, evenly distributed in the interval [start, end]. |
|
None |
|
Return a tensor with steps elements, evenly distributed in the interval [ |
|
None |
|
|
|||
Generate a new tensor, where the positions specified by indices are assigned on_value, and all other positions are assigned off_value. |
|
None |
|
Creates a tensor filled with value ones. |
|
For argument shape, Tensor type input will be deprecated in the future version. |
|
Return a tensor filled with 1, with the same size as input. |
|
None |
|
Returns a tensor with a step length of step in the interval [ start , end ). |
|
None |
|
Returns a tensor with a step length of step in the interval [ start , end ). |
|
None |
|
Creates a tensor filled with value zeros. |
|
For argument size, Tensor type input will be deprecated in the future version. |
|
Return a tensor filled with 0, with the same size as input . |
|
None |
|
Perform Heaviside step function element-wise. |
|
None |
Randomly Generating Functions
API Name |
Description |
Supported Platforms |
Warning |
Generates Bernoulli random values (0 or 1). |
|
None |
|
Generates random numbers according to the Gamma random number distribution. |
|
The Ascend backend does not support the reproducibility of random numbers, so the seed parameter has no effect. |
|
Generates random numbers according to the Laplace random number distribution. |
|
The Ascend backend does not support the reproducibility of random numbers, so the seed parameter has no effect. |
|
Generate a tensor from a multinomial distribution. |
|
The Ascend backend does not support the reproducibility of random numbers, so the seed parameter has no effect. |
|
Generate a tensor from a multinomial distribution. |
|
None |
|
Return a new tensor that fills numbers from the uniform distribution over an interval |
|
The Ascend backend does not support the reproducibility of random numbers, so the seed parameter has no effect. |
|
Return a tensor with the same shape as input that is filled with random numbers from a uniform distribution on the interval |
|
The Ascend backend does not support the reproducibility of random numbers, so the seed parameter has no effect. |
|
Return a tensor whose elements are random integers in the range of [ low , high ) . |
|
The Ascend backend does not support the reproducibility of random numbers, so the seed parameter has no effect. |
|
Returns a tensor with the same shape as input whose elements are random integers in the range of [ low , high ) . |
|
The Ascend backend does not support the reproducibility of random numbers, so the seed parameter has no effect. |
|
Return a new tensor with given shape and dtype, filled with random numbers from the standard normal distribution. |
|
The Ascend backend does not support the reproducibility of random numbers, so the seed parameter has no effect. |
|
Return a tensor with the same shape as input, filled with random numbers from the standard normal distribution. |
|
The Ascend backend does not support the reproducibility of random numbers, so the seed parameter has no effect. |
|
Generate random numbers from the Gamma distribution(s). |
|
None |
|
Generate random number Tensor with shape according to a Poisson distribution with mean rate. |
|
The Ascend backend does not support the reproducibility of random numbers, so the seed parameter has no effect. |
|
Generates random permutation of integers from 0 to n-1. |
|
This is an experimental API that is subject to change or deletion. The Ascend backend does not support the reproducibility of random numbers, so the seed parameter has no effect. |
|
Generates random numbers according to the Laplace random number distribution (mean=0, lambda=1). |
|
The Ascend backend does not support the reproducibility of random numbers, so the seed parameter has no effect. |
|
Generates random numbers according to the standard Normal (or Gaussian) random number distribution. |
|
The Ascend backend does not support the reproducibility of random numbers, so the seed parameter has no effect. |
|
Generates random numbers according to the Uniform random number distribution. |
|
None |
Array Operation
API Name |
Description |
Supported Platforms |
Warning |
Return a tensor of containing the positions of all non-zero elements in the input tensor. |
|
None |
|
Divides batch dimension with blocks and interleaves these blocks back into spatial dimensions. |
|
None |
|
Count the frequency of each value in the input tensor of non-negative ints. |
|
None |
|
Creates a block diagonal matrix from the provided tensor. |
|
None |
|
Broadcasts input tensor to a given shape. |
|
None |
|
Connect input tensors along with the given axis. |
|
None |
|
Divide the channels in a tensor of shape |
|
None |
|
Cut the input Tensor into chunks sub-tensors along the specified axis. |
|
None |
|
Stacks 1-D tensors as columns into a 2-D tensor. |
|
None |
|
Alias for |
None |
||
Returns a tensor of complex numbers that are the complex conjugate of each element in input. |
|
None |
|
Count number of nonzero elements across axis of input tensor. |
|
None |
|
Returns a deepcopy of input tensor. |
|
None |
|
Return a tensor with the input as its diagonal elements and |
|
This is an experimental API that is subject to change or deletion. |
|
If input is a vector (1-D tensor), then returns a 2-D square tensor with the elements of input as the diagonal, If input is a tensor with more than one dimension, then returns a 2-D tensor with diagonal elements equal to a flattened input. |
|
None |
|
Returns diagonals of the input tensor along specified dimension. |
|
None |
|
Embeds the values of the src tensor into input along the diagonal elements of input, with respect to dim1 and dim2 . |
|
None |
|
Returns the shape of the input tensor. |
|
None |
|
Splits a tensor along the 3rd axis. |
|
None |
|
Stacks tensors along the third axis. |
|
None |
|
According to the Einstein summation Convention (Einsum), the product of the input tensor elements is summed along the specified dimension. |
|
None |
|
Adds an additional axis to input tensor. |
|
None |
|
Reverses elements in a tensor along the given dims. |
|
None |
|
Flip the input tensor in left/right direction. |
|
None |
|
Flip the input tensor in up/down direction. |
|
None |
|
Returns the slice of the input tensor corresponding to the elements of input_indices on the specified axis. |
|
None |
|
Gathers elements along an axis specified by dim. |
|
None |
|
Gathers elements along the specified dim and indices. |
|
On Ascend, the behavior is unpredictable in the following cases: the value of index is not in the range [-input.shape[dim], input.shape[dim]) in forward; the value of index is not in the range [0, input.shape[dim]) in backward. |
|
Gathers slices from the input tensor by specified indices. |
|
None |
|
Stacks tensors in sequence horizontally. |
|
None |
|
Splits a tensor into multiple sub-tensors horizontally. |
|
None |
|
Add the elements of input y into input x along the given axis and indices. |
|
None |
|
Fills the elements of the input x with value along the given axis and indices. |
|
None |
|
Select the input tensor according to the specified axis and index and return a new tensor. |
|
None |
|
Add x to v according to the indices. |
|
None |
|
Add updates to var according to the indices and axis. |
|
None |
|
Subtract v in x according to the indices. |
|
None |
|
Updates x to v according to the indices. |
|
This is an experimental API that is subject to change or deletion. |
|
Determine whether the input Tensor contains |
|
None |
|
Fills elements of tensor with value where mask is |
|
None |
|
Return a new 1-D tensor which indexes the input tensor according to the boolean mask. |
|
None |
|
Creates grids of coordinates specified by the 1D inputs。 |
|
None |
|
Slice the tensor from the start position with a length of length along axis . |
|
None |
|
Move axis of an array from source to destination. |
|
None |
|
Swap two dimensions of the input tensor. |
|
None |
|
Replace the NaN, positive infinity and negative infinity values in input with the specified values in nan, posinf and neginf respectively. |
|
For Ascend, it is only supported on Atlas A2 Training Series Products. This is an experimental API that is subject to change or deletion. |
|
Computes the mean of input in specified dimension, ignoring NaN. |
|
None |
|
Computes the median and indices of input in specified dimension, ignoring NaN. |
|
indices does not necessarily contain the first occurrence of each median value found in the input, unless it is unique. |
|
Computes sum of input over a given dimension, ignoring NaN. |
|
None |
|
Return a random tensor that conforms to the normal (Gaussian) distribution. |
|
The Ascend backend does not support the reproducibility of random numbers, so the seed parameter has no effect. |
|
Return the positions of all non-zero values. |
|
None |
|
Return the total number of elements in the tensor. |
|
None |
|
Permute the input tensor along the specified axis. |
|
None |
|
Calculate the number of 1 bits in the binary representation of each element in the input tensor. |
|
None |
|
Return the rank of a tensor. |
|
None |
|
Repeat elements of a tensor along an axis, like |
|
None |
|
Repeat elements of a tensor along an axis, like |
|
None |
|
Reshape the input tensor based on the given shape. |
|
None |
|
This interface will be deprecated in the future, and use |
|
None |
|
Partially reverse the input sequence. |
|
None |
|
Roll the elements of a tensor along a dimension. |
|
None |
|
Alias for |
|
None |
|
Update the value in src to input according to the specified index. |
|
None |
|
Scatters a tensor into a new tensor depending on the specified indices. |
|
None |
|
The conditional tensor determines whether the corresponding element in the output must be selected from input (if True) or other (if False) based on the value of each element. |
|
None |
|
On the specified dimension axis of input , src is scattered into input on the specified index of input . |
|
None |
|
Returns a mask tensor representing the first N positions of each cell. |
|
None |
|
Return the shape of the input tensor. |
|
None |
|
Randomly shuffle a tensor along its first dimension. |
|
None |
|
Count the total number of elements in input_x . |
|
None |
|
Slice a tensor in the specified shape. |
|
None |
|
Embed src into the sliced input along the specified axis . |
|
None |
|
Sort the elements of the input tensor along the given axis. |
|
Currently, the data types of float16, uint8, int8, int16, int32, int64 are well supported. If use float32, it may cause loss of accuracy. |
|
Divides a tensor's spatial dimensions into blocks and combines the block sizes with the original batch. |
|
None |
|
Computes the mean of sparse segments in the input tensor. |
|
None |
|
Split the tensor into chunks along the given axis. |
|
None |
|
Remove length one axes from input tensor. |
|
This is an experimental API that is subject to change or deletion. |
|
Stack input tensors in specified axis. |
|
None |
|
Extracts a strided slice of a Tensor based on begin/end index and strides. |
|
None |
|
Calculate sum of tensor elements over a given dim. |
|
None |
|
Interchange two axes of a tensor. |
|
None |
|
Interchange two dims of a tensor. |
|
None |
|
Return a new tensor by adding the values from updates in input_x indicated by indices . |
|
None |
|
Return a new tensor which input_x is divided by the values from updates indicated by indices . |
|
None |
|
Return a new tensor by performing a maximum update on input_x at the specified indices with the given update values. |
|
None |
|
Return a new tensor by performing a minimum update on input_x at the specified indices with the given update values. |
|
None |
|
Return a new tensor by performing a multiplication update on input_x at the specified indices with the given update values. |
|
None |
|
Return a new tensor by performing a subtraction update on input_x at the specified indices with the given update values. |
|
None |
|
Return a new tensor by performing a specified operation update on input_x at the specified indices with the given update values. |
|
The order in which updates are applied is nondeterministic, meaning that if there are multiple index vectors in indices that correspond to the same position, the value of that position in the output will be nondeterministic. On Ascend, the reduction only support set to "none" for now. On Ascend, the data type of input_x must be float16 or float32. This is an experimental API that is subject to change or deletion. |
|
Split the input tensor into multiple subtensors according to the specified indices or chunks. |
|
None |
|
Creates a new tensor by repeating the elements in the input tensor dims times. |
None |
||
Zero the input tensor above the diagonal specified. |
|
None |
|
Zero the input tensor below the diagonal specified. |
|
This is an experimental API that is subject to change or deletion. |
|
Transpose dimensions of the input tensor according to input permutation. |
|
None |
|
Removes a tensor dimension in specified axis. |
|
None |
|
Extracts sliding local blocks from a batched input tensor. |
|
The output is a 3-dimensional Tensor whose shape is |
|
Returns the unique elements of input tensor and also return a tensor containing the index of each value of input tensor corresponding to the output unique tensor. |
|
This is an experimental API that is subject to change or deletion. |
|
Returns the elements that are unique in each consecutive group of equivalent elements in the input tensor. |
|
None |
|
Returns unique elements and relative indexes in 1-D tensor, filled with padding num. |
Deprecated |
|
|
Compute the maximum of the input tensor along segments. |
|
None |
|
Compute the minimum of the input tensor along segments. |
|
None |
|
Compute the product of the input tensor along segments. |
|
None |
|
Compute the sum of the input tensor along segments. |
|
None |
|
Adds an additional dimension to the input tensor at the given dimension. |
|
None |
|
Unstack the input tensor along the specified axis. |
|
None |
|
Return a real tensor with the last dimension of size 2, composed of the real and imaginary parts of the complex elements in the input tensor. |
|
None |
|
Split the input tensor with two or more dimensions, into multiple sub-tensors vertically according to indices_or_sections. |
|
None |
|
Stacks tensors in sequence vertically. |
|
None |
|
Return a tensor in which the elements are selected from input or other based on the condition. |
|
None |
|
Compute the cross product of two input tensors along the specified dimension. |
|
None |
|
Returns a tensor where each subtensor along the specified dimension is renormalized such that its p norm is less than or equal to maxnorm. |
|
None |
Type Cast
API Name |
Description |
Supported Platforms |
Warning |
Returns a tensor with the new specified data type. |
|
None |
|
Check whether the input object is |
|
None |
|
The interface is deprecated from version 2.3 and will be removed in a future version, please use int(x) or float(x) instead. |
Deprecated |
None |
|
Converts a scalar to a tensor with the specified dtype. |
|
None |
|
Converts a tuple to a tensor. |
|
None |
Gradient Clipping
API Name |
Description |
Supported Platforms |
Warning |
Clips tensor values by the ratio of the sum of their norms. |
|
None |
|
Clips tensor values to a specified min and max. |
|
None |
|
The input Tensor is cropped based on norm. |
|
None |
Parameter Operation Functions
API Name |
Description |
Supported Platforms |
Warning |
Assigns a parameter or tensor with a value. |
|
None |
|
Updates a parameter or tensor by adding a value to it. |
|
None |
|
Updates a parameter or tensor by subtracting a value from it. |
|
None |
|
Perform an addition update on input_x based on the specified indices and update values. |
|
None |
|
Perform a division update on input_x based on the specified indices and update values. |
|
None |
|
Perform a minimum update on input_x based on the specified indices and update values. |
|
None |
|
Perform a maximum update on input_x based on the specified indices and update values. |
|
None |
|
Perform a multiplication update on input_x based on the specified indices and update values. |
|
None |
|
Perform a sparse addition update on input_x based on the specified indices and update values. |
|
None |
|
Perform a sparse division update on input_x based on the specified indices and update values. |
|
None |
|
Perform a sparse maximum update on input_x based on the specified indices and update values. |
|
None |
|
Perform a sparse minimum update on input_x based on the specified indices and update values. |
|
None |
|
Perform a sparse multiplication update on input_x based on the specified indices and update values. |
|
None |
|
Perform a sparse subtraction update on input_x based on the specified indices and update values. |
|
None |
|
Updates the input tensor values using the given input indices and update values. |
|
None |
Differential Functions
API Name |
Description |
Supported Platforms |
Warning |
This function is designed to calculate the higher order differentiation of given composite function. |
|
None |
|
This function is designed to calculate the higher order differentiation of given composite function. |
|
None |
|
StopGradient is used for eliminating the effect of a value on the gradient, such as truncating the gradient propagation from an output of a function. |
|
None |
Debugging Functions
API Name |
Description |
Supported Platforms |
Warning |
Outputs the inputs to stdout. |
|
None |
|
Save tensor in npy format. |
|
The parameter mode will no longer support the value 'all'. |
Sparse Functions
Warning
These are experimental APIs that are subject to change or deletion.
API Name |
Description |
Supported Platforms |
Warning |
Convert a Tensor to COOTensor. |
|
None |
|
Convert a Tensor to CSRTensor. |
|
None |
|
Converts a CSRTensor to COOTensor. |
|
None |
COO Functions
Warning
These are experimental APIs that are subject to change or deletion.
API Name |
Description |
Supported Platforms |
Warning |
Returns coo_absolute value of a COOTensor element-wise. |
|
None |
|
Computes arccosine of input coo_tensors element-wise. |
|
None |
|
Computes inverse hyperbolic cosine of the inputs element-wise. |
|
Given an input COOTensor x, the function computes inverse hyperbolic cosine of every element. Input range is [1, inf]. |
|
Computes the sum of x1(COOTensor) and x2(COOTensor), and return a new COOTensor based on the computed result and thresh. |
|
None |
|
Computes arcsine of input coo_tensors element-wise. |
|
None |
|
Computes inverse hyperbolic sine of the input element-wise. |
|
None |
|
Computes the trigonometric inverse tangent of the input element-wise. |
|
None |
|
Computes inverse hyperbolic tangent of the input element-wise. |
|
This is an experimental API that is subject to change or deletion. |
|
Rounds a COOTensor up to the closest integer element-wise. |
|
None |
|
concatenates the input SparseTensor(COO format) along the specified dimension. |
|
This is an experimental API that is subjected to change or deletion. Only supported on CPU now. |
|
Computes cosine of input element-wise. |
|
If use float64, there may be a problem of missing precision. |
|
Computes hyperbolic cosine of input element-wise. |
|
None |
|
Returns the element-wise exponential of a COOTensor. |
|
None |
|
Returns exponential then minus 1 of a COOTensor element-wise. |
|
None |
|
Rounds a COOTensor down to the closest integer element-wise. |
|
None |
|
Computes Reciprocal of input COOTensor element-wise. |
|
None |
|
Determines which elements are finite for each position. |
|
None |
|
Determines which elements are inf or -inf for each position. |
|
None |
|
Determines which elements are NaN for each position. |
|
None |
|
Returns the natural logarithm of a COOTensor element-wise. |
|
If the input value of operator Log is within the range (0, 0.01] or [0.95, 1.05], the output accuracy may be affacted. |
|
Returns the natural logarithm of one plus the input COOTensor element-wise. |
|
None |
|
Returns a COOTensor with coo_negative values of the input COOTensor element-wise. |
|
None |
|
Computes ReLU (Rectified Linear Unit activation function) of input coo_tensors element-wise. |
|
None |
|
Computes ReLU (Rectified Linear Unit) upper bounded by 6 of input coo_tensors element-wise. |
|
None |
|
Returns half to even of a COOTensor element-wise. |
|
None |
|
Sigmoid activation function. |
|
None |
|
Computes sine of the input element-wise. |
|
None |
|
Computes hyperbolic sine of the input element-wise. |
|
None |
|
Softsign activation function. |
|
None |
|
Computes sqrt of a COOTensor element-wise. |
|
None |
|
Returns square of a COOTensor element-wise. |
|
None |
|
Computes tangent of x element-wise. |
|
None |
|
Computes hyperbolic tangent of input element-wise. |
|
None |
CSR Functions
Warning
These are experimental APIs that are subject to change or deletion.
API Name |
Description |
Supported Platforms |
Warning |
Returns csr_absolute value of a CSRTensor element-wise. |
|
None |
|
Computes arccosine of input csr_tensors element-wise. |
|
None |
|
Computes inverse hyperbolic cosine of the inputs element-wise. |
|
None |
|
Computes the linear combination of two input CSRTensors a and b. |
|
None |
|
Computes arcsine of input csr_tensors element-wise. |
|
None |
|
Computes inverse hyperbolic sine of the input element-wise. |
|
None |
|
Computes the trigonometric inverse tangent of the input element-wise. |
|
None |
|
Computes inverse hyperbolic tangent of the input element-wise. |
|
This is an experimental API that is subject to change or deletion. |
|
Rounds a CSRTensor up to the closest integer element-wise. |
|
None |
|
Computes cosine of input element-wise. |
|
Currently support data types float16 and float32. If use float64, there may be a problem of missing precision. |
|
Computes hyperbolic cosine of input element-wise. |
|
None |
|
Returns csr_exponential of a CSRTensor element-wise. |
|
None |
|
Returns exponential then minus 1 of a CSRTensor element-wise. |
|
None |
|
Rounds a CSRTensor down to the closest integer element-wise. |
|
None |
|
Computes Reciprocal of input CSRTensor element-wise. |
|
None |
|
Determines which elements are finite for each position. |
|
None |
|
Determines which elements are inf or -inf for each position. |
|
None |
|
Determines which elements are NaN for each position. |
|
None |
|
Returns the natural logarithm of a CSRTensor element-wise. |
|
If the input value of operator Log is within the range (0, 0.01] or [0.95, 1.05], the output accuracy may be affacted. |
|
Returns the natural logarithm of one plus the input CSRTensor element-wise. |
|
None |
|
Return the matrix multiplication result of the right-multiply matrix (dense or CSRTensor) of the CSRTensor. |
|
None |
|
Returns a CSRTensor with csr_negative values of the input CSRTensor element-wise. |
|
None |
|
Computes ReLU (Rectified Linear Unit activation function) of input csr_tensors element-wise. |
|
None |
|
Computes ReLU (Rectified Linear Unit) upper bounded by 6 of input csr_tensors element-wise. |
|
None |
|
Returns half to even of a CSRTensor element-wise. |
|
None |
|
Sigmoid activation function. |
|
None |
|
Computes sine of the input element-wise. |
|
None |
|
Computes hyperbolic sine of the input element-wise. |
|
None |
|
Calculates the softmax of a CSRTensorMatrix. |
|
None |
|
Softsign activation function. |
|
None |
|
Returns sqrt of a CSRTensor element-wise. |
|
None |
|
Returns square of a CSRTensor element-wise. |
|
None |
|
Computes tangent of x element-wise. |
|
None |
|
Computes hyperbolic tangent of input element-wise. |
|
None |
MC2 Functions
Warning
These are experimental APIs that are subject to change or deletion.
API Name |
Description |
Supported Platforms |
Warning |
In the TP segmentation scenario, allgather and matmul are fused, and communication and computational pipelines are parallelized within the fusion operator. |
|
This is an experimental API that is subject to change or deletion. |
|
In the TP segmentation scenario, matmul and reducescatter are fused, and communication and computational pipelines are parallelized within the fusion operator. |
|
This is an experimental API that is subject to change or deletion. |