mindspore.ops.primitive
operators that can be used for constructor function of Cell
import mindspore.ops as ops
Compared with the previous version, the added, deleted and supported platforms change information of mindspore.ops.primitive operators in MindSpore, please refer to the link API Updates .
Operator Primitives
Primitive is the base class of operator primitives in python. |
|
PrimitiveWithCheck is the base class of primitives in python, which defines functions to check the input arguments of operators, but uses the infer method registered in c++ source codes. |
|
PrimitiveWithInfer is the base class of primitives in python and defines functions for tracking inference in python. |
Decorators
Creates a PrimitiveWithInfer operator that can infer the value at compile time. |
|
A decorator which is used to bind the registration information to the func parameter of |
|
The decorator of the Hybrid DSL function for the Custom Op. |
|
A decorator which is used to register an operator. |
|
Primitive attributes register. |
Neural Network Layer Operators
Neural Network
API Name |
Description |
Supported Platforms |
Average pooling operation. |
|
|
3D Average pooling operation. |
|
|
Batch Normalization for input data and updated parameters. |
|
|
2D convolution layer. |
|
|
Calculates a 2D transposed convolution, which can be regarded as Conv2d for the gradient of the input, also called deconvolution, although it is not an actual deconvolution. |
|
|
3D convolution layer. |
|
|
Computes a 3D transposed convolution, which is also known as a deconvolution (although it is not an actual deconvolution). |
|
|
Performs greedy decoding on the logits given in inputs. |
|
|
Permute input tensor from src_format to dst_format. |
|
|
During training, randomly zeroes some of the elements of the input tensor with probability 1-keep_prob from a Bernoulli distribution. |
|
|
During training, randomly zeroes some channels of the input tensor with probability 1-keep_prob from a Bernoulli distribution(For a 4-dimensional tensor with a shape of NCHW, the channel feature map refers to a 2-dimensional feature map with the shape of HW). |
|
|
During training, randomly zeroes some channels of the input tensor with probability 1-keep_prob from a Bernoulli distribution(For a 5-dimensional tensor with a shape of NCDHW, the channel feature map refers to a 3-dimensional feature map with a shape of DHW). |
|
|
Applies a single-layer gated recurrent unit (GRU) to an input sequence. |
|
|
Applies a recurrent neural network to the input. |
|
|
Flattens a tensor without changing its batch size on the 0-th axis. |
|
|
Performs fractional avg pooling on the input. |
|
|
Performs fractional max pooling on the input. |
|
|
Applies the Layer Normalization to the input tensor. |
|
|
Local Response Normalization. |
|
|
Performs the Long Short-Term Memory (LSTM) on the input. |
|
|
Max pooling operation. |
|
|
Applies a 3D max pooling over an input Tensor which can be regarded as a composition of 3D planes. |
|
|
Performs a 3D max pooling on the input Tensor and returns both max values and indices. |
|
|
Performs max pooling on the input Tensor and returns both max values and indices. |
|
|
Computes a partial inverse of MaxPool2D. |
|
|
Pads the input tensor according to the paddings and mode. |
|
|
Pads the input tensor according to the paddings. |
|
|
Returns a slice of input tensor based on the specified indices. |
|
|
Extends the last dimension of the input tensor from 1 to pad_dim_size, by filling with 0. |
|
|
Resizes an image to a certain size using the bilinear interpolation. |
|
|
Resizes the input tensor to a given size by using the nearest neighbor algorithm. |
|
|
Performs nearest neighbor upsampling operation. |
|
|
Performs upsampling with trilinear interpolation across 3dims for 5dim input Tensor. |
|
Loss Function
API Name |
Description |
Supported Platforms |
Adds sigmoid activation function to input logits, and uses the given logits to compute binary cross entropy between the logits and the label. |
|
|
Computes the binary cross entropy between the logits and the labels. |
|
|
Calculates the CTC (Connectionist Temporal Classification) loss and the gradient. |
|
|
Computes the Kullback-Leibler divergence between the logits and the labels. |
|
|
Calculates half of the L2 norm, but do not square the result. |
|
|
MultilabelMarginLoss operation. |
|
|
Gets the negative log likelihood loss between logits and labels. |
|
|
Computes the RNNTLoss and its gradient with respect to the softmax outputs. |
|
|
Uses the given logits to compute sigmoid cross entropy between the logits and the label. |
|
|
Calculate the smooth L1 loss, and the L1 loss function has robustness. |
|
|
SoftMarginLoss operation. |
|
|
Gets the softmax cross-entropy value between logits and labels with one-hot encoding. |
|
|
Computes the softmax cross-entropy value between logits and sparse encoding labels. |
|
Activation Function
API Name |
Description |
Supported Platforms |
Exponential Linear Uint activation function. |
|
|
Fast Gaussian Error Linear Units activation function. |
|
|
Gaussian Error Linear Units activation function. |
|
|
Hard Shrink activation function. |
|
|
Hard sigmoid activation function. |
|
|
Hard swish activation function. |
|
|
Log Softmax activation function. |
|
|
Computes MISH(A Self Regularized Non-Monotonic Neural Activation Function) of input tensors element-wise. |
|
|
Parametric Rectified Linear Unit activation function. |
|
|
Computes ReLU (Rectified Linear Unit activation function) of input tensors element-wise. |
|
|
Computes ReLU (Rectified Linear Unit) upper bounded by 6 of input tensors element-wise. |
|
|
Activation function SeLU (Scaled exponential Linear Unit). |
|
|
Sigmoid activation function. |
|
|
Applies the Softmax operation to the input tensor on the specified axis. |
|
|
Softplus activation function. |
|
|
Applies the SoftShrink function element-wise. |
|
|
Softsign activation function. |
|
|
Computes hyperbolic tangent of input element-wise. |
|
Optimizer
API Name |
Description |
Supported Platforms |
Updates gradients by the Adaptive Moment Estimation (Adam) algorithm. |
|
|
Updates gradients by the Adaptive Moment Estimation algorithm with weight decay (AdamWeightDecay). |
|
|
2D adaptive average pooling for temporal data. |
|
|
Applies a 3D adaptive max pooling over an input signal composed of several input planes. |
|
|
Updates relevant entries according to the adadelta scheme. |
|
|
Updates relevant entries according to the adagrad scheme. |
|
|
Update var according to the proximal adagrad scheme. |
|
|
Updates relevant entries according to the adagradv2 scheme. |
|
|
Updates relevant entries according to the adamax scheme. |
|
|
Updates relevant entries according to the AddSign algorithm. |
|
|
Optimizer that implements the centered RMSProp algorithm. |
|
|
Updates relevant entries according to the FTRL scheme. |
|
|
Updates var by subtracting alpha * delta from it. |
|
|
Optimizer that implements the Momentum algorithm. |
|
|
Updates relevant entries according to the AddSign algorithm. |
|
|
Updates relevant entries according to the proximal adagrad algorithm. |
|
|
Updates relevant entries according to the FOBOS(Forward Backward Splitting) algorithm. |
|
|
Optimizer that implements the Root Mean Square prop(RMSProp) algorithm. |
|
|
Conducts LARS (layer-wise adaptive rate scaling) update on the sum of squares of gradient. |
|
|
Updates relevant entries according to the adagrad scheme, one more epsilon attribute than SparseApplyAdagrad. |
|
|
Updates relevant entries according to the proximal adagrad algorithm. |
|
|
Computes the stochastic gradient descent. |
|
|
Updates relevant entries according to the FTRL-proximal scheme For more details, please refer to |
|
|
Updates relevant entries according to the FTRL-proximal scheme. |
|
Distance Function
API Name |
Description |
Supported Platforms |
Computes batched the p-norm distance between each pair of the two collections of row vectors. |
|
|
Computes the Levenshtein Edit Distance. |
|
|
Returns the matrix norm or vector norm of a given tensor. |
|
Sampling Operator
API Name |
Description |
Supported Platforms |
Compute accidental hits of sampled classes which match target classes. |
|
|
Generates random labels with a log-uniform distribution for sampled_candidates. |
|
|
Uniform candidate sampler. |
|
Image Processing
API Name |
Description |
Supported Platforms |
Adjust hue of RGB images. |
|
|
Decodes bounding boxes locations. |
|
|
Encodes bounding boxes locations. |
|
|
Checks bounding box. |
|
|
Greedily selects a subset of bounding boxes in descending order of score. |
|
|
Extracts crops from the input image tensor and resizes them. |
|
|
Extracts glimpse from the input image tensor and return a window. |
|
|
Extract patches from input and put them in the "depth" output dimension. |
|
|
Convert one or more images from HSV to RGB. |
|
|
Calculates intersection over union for boxes. |
|
|
L2 Normalization Operator. |
|
|
Non-maximum Suppression. |
|
|
Convert one or more images from RGB to HSV. |
|
|
Computes the Region of Interest (RoI) Align operator. |
|
|
Generate a single randomly distorted bounding box for an image. |
|
|
Scale And Translate the input image tensor. |
|
Text Processing
API Name |
Description |
Supported Platforms |
Updates the probability of occurrence of words with its corresponding n-grams. |
|
Mathematical Operators
API Name |
Description |
Supported Platforms |
Computes BesselJ0 of input element-wise. |
|
|
Computes BesselJ1 of input element-wise. |
|
|
Computes BesselK0 of input element-wise. |
|
|
Computes BesselK0e of input element-wise. |
|
|
Computes BesselK1 of input element-wise. |
|
|
Computes BesselK1e of input element-wise. |
|
|
Computes BesselY0 of input element-wise. |
|
|
Computes BesselY1 of input element-wise. |
|
|
Computes the regularized incomplete beta integral \(I_{x}(a, b)\). |
|
|
Counts the number of occurrences of each value in an integer array. |
|
|
Bucketizes 'input' based on 'boundaries'. |
|
|
Compare values of x to threshold and pack resulting bits into a uint8. |
|
|
Returns a complex Tensor from the real part and the imag part. |
|
|
Computes greatest common divisor of input tensors element-wise. |
|
Element-wise Operator
API Name |
Description |
Supported Platforms |
Returns absolute value of a tensor element-wise. |
|
|
Computes accumulation of all input tensors element-wise. |
|
|
Computes arccosine of input tensors element-wise. |
|
|
Computes inverse hyperbolic cosine of the inputs element-wise. |
|
|
Adds two input tensors element-wise. |
|
|
Performs the element-wise division of tensor x1 by tensor x2, multiply the result by the scalar value and add it to input_data. |
|
|
Performs the element-wise product of tensor x1 and tensor x2, multiply the result by the scalar value and add it to input_data. |
|
|
Computes addition of all input tensors element-wise. |
|
|
Computes arcsine of input tensors element-wise. |
|
|
Computes inverse hyperbolic sine of the input element-wise. |
|
|
Computes the trigonometric inverse tangent of the input element-wise. |
|
|
Returns arctangent of x/y element-wise. |
|
|
Computes inverse hyperbolic tangent of the input element-wise. |
|
|
Computes BesselI0e of input element-wise. |
|
|
Computes BesselI1e of input element-wise. |
|
|
Returns bitwise and of two tensors element-wise. |
|
|
Returns bitwise or of two tensors element-wise. |
|
|
Returns bitwise xor of two tensors element-wise. |
|
|
Rounds a tensor up to the closest integer element-wise. |
|
|
Returns a tensor of complex numbers that are the complex conjugate of each element in input. |
|
|
Computes cosine of input element-wise. |
|
|
Computes hyperbolic cosine of input element-wise. |
|
|
Computes the quotient of dividing the first input tensor by the second input tensor element-wise. |
|
|
Operates a safe division between x1 and x2 element-wise. |
|
|
Sums the product of the elements of the input Tensor along dimensions specified notation based on the Einstein summation convention(Einsum). |
|
|
Computes the Gauss error function of x element-wise. |
|
|
Computes the complementary error function of x element-wise. |
|
|
Computes the inverse error function of input. |
|
|
Returns exponential of a tensor element-wise. |
|
|
Returns exponential then minus 1 of a tensor element-wise. |
|
|
Rounds a tensor down to the closest integer element-wise. |
|
|
Divides the first input tensor by the second input tensor element-wise and round down to the closest integer. |
|
|
Computes the remainder of division element-wise, and it's a flooring divide. |
|
|
Returns a new tensor containing imaginary value of the input. |
|
|
Computes Reciprocal of input tensor element-wise. |
|
|
Flips all bits of input tensor element-wise. |
|
|
Calculate the linear interpolation between two tensors based on the weight parameter. |
|
|
Returns the natural logarithm of a tensor element-wise. |
|
|
Returns the natural logarithm of one plus the input tensor element-wise. |
|
|
Computes the "logical AND" of two tensors element-wise. |
|
|
Computes the "logical NOT" of a tensor element-wise. |
|
|
Computes the "logical OR" of two tensors element-wise. |
|
|
Computes the remainder of dividing the first input tensor by the second input tensor element-wise. |
|
|
Multiplies two tensors element-wise. |
|
|
Computes x * y element-wise. |
|
|
Returns a tensor with negative values of the input tensor element-wise. |
|
|
Returns the next representable floating-point value after x1 towards x2 element-wise. |
|
|
Calculates the y power of each element in x. |
|
|
Returns a Tensor that is the real part of the input. |
|
|
Divides the first input tensor by the second input tensor in floating-point type element-wise. |
|
|
Returns reciprocal of a tensor element-wise. |
|
|
Returns an integer that is closest to input_x element-wise. |
|
|
Returns half to even of a tensor element-wise. |
|
|
Computes reciprocal of square root of input tensor element-wise. |
|
|
Performs sign on the tensor element-wise. |
|
|
Computes sine of the input element-wise. |
|
|
Computes hyperbolic sine of the input element-wise. |
|
|
Returns square root of a tensor element-wise. |
|
|
Returns square of a tensor element-wise. |
|
|
Subtracts the second input tensor from the first input tensor element-wise and returns square of it. |
|
|
Returns the square sum of a tensor element-wise. |
|
|
Subtracts the second input tensor from the first input tensor element-wise. |
|
|
Computes tangent of x element-wise. |
|
|
Returns a new tensor with the truncated integer values of the elements of input. |
|
|
Divides the first input tensor by the second input tensor element-wise for integer types, negative numbers will round fractional quantities towards zero. |
|
|
Returns the remainder of division element-wise. |
|
|
Divides the first input tensor by the second input tensor element-wise. |
|
|
Computes the first input tensor multiplied by the logarithm of second input tensor element-wise. |
|
Reduction Operator
API Name |
Description |
Supported Platforms |
Returns the indices of the maximum value of a tensor across the axis. |
|
|
Calculates the maximum value along with the given axis for the input tensor and, returns the maximum values and indices. |
|
|
Returns the indices of the minimum value of a tensor across the axis. |
|
|
Calculates the minimum value along with the given axis for the input tensor, and returns the minimum values and indices. |
|
|
Computes the euclidean norm of elements across dimensions of a tensor. |
|
|
Reduces a dimension of a tensor by the "logicalAND" of all elements in the dimension, by default. |
|
|
Reduces a dimension of a tensor by the "logical OR" of all elements in the dimension, by default. |
|
|
Reduces a dimension of a tensor by the maximum value in this dimension, by default. |
|
|
Reduces a dimension of a tensor by averaging all elements in the dimension, by default. |
|
|
Reduces a dimension of a tensor by the minimum value in the dimension, by default. |
|
|
Reduces a dimension of a tensor by multiplying all elements in the dimension, by default. |
|
|
Returns the standard-deviation and mean of each row of the input tensor in the dimension axis. |
|
|
Reduces a dimension of a tensor by summing all elements in the dimension, by default. |
|
Comparison Operator
API Name |
Description |
Supported Platforms |
Returns True if abs(x-y) is smaller than tolerance element-wise, otherwise False. |
|
|
Computes the equivalence between two tensors element-wise. |
|
|
Computes the number of the same elements of two tensors. |
|
|
Compare the value of the input parameters \(x,y\) element-wise, and the output result is a bool value. |
|
|
Computes the boolean value of \(x >= y\) element-wise. |
|
|
Determines whether the targets are in the top k predictions. |
|
|
Determines which elements are finite for each position. |
|
|
Determines which elements are inf or -inf for each position. |
|
|
Determines which elements are NaN for each position. |
|
|
Computes the boolean value of \(x < y\) element-wise. |
|
|
Computes the boolean value of \(x <= y\) element-wise. |
|
|
Computes the maximum of input tensors element-wise. |
|
|
Computes the minimum of input tensors element-wise. |
|
|
Computes the non-equivalence of two tensors element-wise. |
|
|
Finds values and indices of the k largest entries along the last dimension. |
|
Linear Algebraic Operator
API Name |
Description |
Supported Platforms |
Computes matrix multiplication between two tensors by batch. |
|
|
Returns the sum of the input Tensor and the bias Tensor. |
|
|
Ger product of x1 and x2. |
|
|
Multiplies matrix a and matrix b. |
|
|
Returns the inverse of the input matrix. |
|
Tensor Operation Operator
Tensor Construction
API Name |
Description |
Supported Platforms |
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 be expressed. |
|
|
Creates a tensor with ones on the diagonal and zeros in the rest. |
|
|
Create a Tensor of the specified shape and fill it with the specified value. |
|
|
Returns a Tensor whose value is num evenly spaced in the interval start and stop (including start and stop), and the length of the output Tensor is num. |
|
|
Computes a one-hot tensor. |
|
|
Creates a tensor filled with value ones. |
|
|
Returns a Tensor with a value of 1 and its shape and data type is the same as the input. |
|
|
Creates a tensor filled with value zeros. |
|
|
Returns a Tensor with a value of 0 and its shape and data type is the same as the input. |
|
Random Generation Operator
API Name |
Description |
Supported Platforms |
Produces random positive floating-point values x, distributed according to probability density function: |
|
|
Returns a tensor sampled from the multinomial probability distribution located in the corresponding row of tensor input. |
|
|
Generates random samples from a given categorical distribution tensor. |
|
|
Generates a random sample as index tensor with a mask tensor from a given tensor. |
|
|
Generates n random samples from 0 to n-1 without repeating. |
|
|
Generates random numbers according to the Laplace random number distribution (mean=0, lambda=1). |
|
|
Generates random numbers according to the standard Normal (or Gaussian) random number distribution. |
|
|
Produces random integer values i, uniformly distributed on the closed interval [minval, maxval), that is, distributed according to the discrete probability function: |
|
|
Produces random floating-point values, uniformly distributed to the interval [0, 1). |
|
Array Operation
API Name |
Description |
Supported Platforms |
Divides batch dimension with blocks and interleaves these blocks back into spatial dimensions. |
|
|
Divides batch dimension with blocks and interleaves these blocks back into spatial dimensions. |
|
|
Broadcasts input tensor to a given shape. |
|
|
Returns a tensor with the new specified data type. |
|
|
Connect tensor in the specified axis. |
|
|
Computes the cumulative product of the tensor x along axis. |
|
|
Computes the cumulative sum of input tensor along axis. |
|
|
Returns the dimension index in the destination data format given in the source data format. |
|
|
Rearrange blocks of depth data into spatial dimensions. |
|
|
Returns the data type of the input tensor as mindspore.dtype. |
|
|
Computes the eigenvalues and eigenvectors of a square matrix(batch square matrices). |
|
|
Returns a new view of the self tensor with singleton dimensions expanded to a larger size. |
|
|
Adds an additional dimension to input_x at the given axis. |
|
|
Determines if the elements contain Not a Number(NaN), infinite or negative infinite. |
|
|
Fill the main diagonal of a tensor that has at least 2-dimensions. |
|
|
Returns the slice of the input tensor corresponding to the elements of input_indices on the specified axis. |
|
|
Gathers elements along an axis specified by dim. |
|
|
Gathers slices from a tensor by indices. |
|
|
Computes the hamming window function with input window length. |
|
|
Computes the histogram of a tensor. |
|
|
Returns a rank 1 histogram counting the number of entries in values that fall into every bin. |
|
|
Returns a Tensor with the same shape and contents as input. |
|
|
Adds tensor y to specified axis and indices of tensor x. |
|
|
Adds v into specified rows of x. |
|
|
Subtracts v into specified rows of x. |
|
|
Updates specified rows with values in v. |
|
|
Computes the inverse of an index permutation. |
|
|
Computes least common multiplier of input tensors element-wise. |
|
|
Shift the value of each position of the tensor to the left several bits. |
|
|
Computes the difference between two lists of numbers. |
|
|
Returns the diagonal part of a tensor. |
|
|
Returns a batched diagonal tensor with given batched diagonal values. |
|
|
Returns a one-dimensional tensor of size steps whose values are evenly spaced from \(base^{start}\) to \(base^{end}\) , inclusive, on a logarithmic scale with base. |
|
|
Computes the solutions of the least squares and minimum norm problems of full-rank matrix x of size \((m \times n)\) and matrix a of size \((m \times k)\). |
|
|
Fills elements with value where mask is True. |
|
|
Returns a new 1-D Tensor which indexes the x tensor according to the boolean mask. |
|
|
Computes the matrix exponential of a square matrix. |
|
|
Computes the n-th power of a batch of square matrices. |
|
|
Generates coordinate matrices from given coordinate tensors. |
|
|
Concats input tensors along the first dimension. |
|
|
Computes element-wise population count(a.k.a bitsum, bitcount). |
|
|
Creates a sequence of numbers that begins at start and extends by increments of delta up to but not including limit. |
|
|
Returns the rank of a tensor. |
|
|
Rearranges the input Tensor based on the given shape. |
|
|
Resizes the input tensor to specific size by using the nearest neighbor algorithm. |
|
|
Reverses variable length slices. |
|
|
Reverses specific dimensions of a tensor. |
|
|
Shift the value of each position of Tensor input_x to the right by corresponding bits in Tensor input_y. |
|
|
Rolls the elements of a tensor along an axis. |
|
|
The output of the operation is produced by creating a copy of the input input_x, and then add updating its value to values specified by updates at specific index positions specified by indices. |
|
|
Scatters a tensor into a new tensor depending on the specified indices. |
|
|
Applies sparse division to individual values or slices in a tensor. |
|
|
Applies sparse maximum to individual values or slices in a tensor. |
|
|
Applies sparse multiplication to individual values or slices in a tensor. |
|
|
The conditional tensor determines whether the corresponding element in the output must be selected from \(x\) (if True) or \(y\) (if False) based on the value of each element. |
|
|
Returns the shape of the input tensor. |
|
|
Returns a Scalar of type int that represents the size of the input Tensor and the total number of elements in the Tensor. |
|
|
Slices a tensor in the specified shape. |
|
|
Sorts the elements of the input tensor along the given dimension in the specified order. |
|
|
Divides spatial dimensions into blocks and combines the block size with the original batch. |
|
|
Rearrange blocks of spatial data into depth. |
|
|
Returns a slice of input tensor based on the specified indices and axis. |
|
|
Splits the input tensor into output_num of tensors along the given axis and output numbers. |
|
|
Return the Tensor after deleting the dimension of size 1 in the specified axis. |
|
|
Stacks a list of tensors in specified axis. |
|
|
STFTs can be used as a way of quantifying the change of a nonstationary signal’s frequency and phase content over time. |
|
|
Extracts a strided slice of a tensor. |
|
|
Creates a new tensor by adding the values from the positions in input_x indicated by indices, with values from updates. |
|
|
Creates a new tensor by dividing the values from the positions in input_x indicated by indices, with values from updates. |
|
|
By comparing the value at the position indicated by indices in x with the value in the updates, the value at the index will eventually be equal to the largest one to create a new tensor. |
|
|
By comparing the value at the position indicated by indices in input_x with the value in the updates, the value at the index will eventually be equal to the smallest one to create a new tensor. |
|
|
Creates a new tensor by multiplying the values from the positions in input_x indicated by indices, with values from updates. |
|
|
Creates a new tensor by subtracting the values from the positions in input_x indicated by indices, with values from updates. |
|
|
Creates a new tensor by updating the positions in input_x indicated by indices, with values from update. |
|
|
Returns the shape of the input tensor. |
|
|
Replicates an input tensor with given multiples times. |
|
|
Returns a new tensor that is the sum of the input trace. |
|
|
Permutes the dimensions of the input tensor according to input permutation. |
|
|
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. |
|
|
Returns unique elements and relative indexes in 1-D tensor, filled with padding num. |
|
|
Computes the maximum along segments of a tensor. |
|
|
Computes the minimum of a tensor along segments. |
|
|
Computes the product of a tensor along segments. |
|
|
Computes the sum of a tensor along segments. |
|
|
Unstacks tensor in specified axis. |
|
Type Conversion
API Name |
Description |
Supported Platforms |
Casts the input scalar to another type. |
|
|
Converts a scalar to a Tensor, and converts the data type to the specified type. |
|
|
Converts a tuple to a tensor. |
|
Parameter Operation Operator
API Name |
Description |
Supported Platforms |
Assigns Parameter with a value. |
|
|
Updates a Parameter by adding a value to it. |
|
|
Updates a Parameter by subtracting a value from it. |
|
|
Updates the value of the input tensor through the addition operation. |
|
|
Updates the value of the input tensor through the divide operation. |
|
|
Updates the value of the input tensor through the maximum operation. |
|
|
Updates the value of the input tensor through the minimum operation. |
|
|
Updates the value of the input tensor through the multiply operation. |
|
|
Applies sparse addition to individual values or slices in a tensor. |
|
|
Applies sparse subtraction to individual values or slices in a tensor. |
|
|
Updates tensor values by using input indices and value. |
|
|
Applies sparse addition to the input using individual values or slices. |
|
|
Updates the value of the input tensor through the subtraction operation. |
|
|
Updates tensor values by using input indices and value. |
|
Data Operation Operator
API Name |
Description |
Supported Platforms |
Returns the next element in the dataset queue. |
|
Communication Operator
Note that the APIs in the following list need to preset communication environment variables. For the Ascend devices, users need to prepare the rank table, set rank_id and device_id. Please see the Ascend tutorial for more details. For the GPU device, users need to prepare the host file and mpi, please see the GPU tutorial .
API Name |
Description |
Supported Platforms |
Gathers tensors from the specified communication group. |
|
|
Reduces the tensor data across all devices in such a way that all devices will get the same final result. |
|
|
AlltoAll is a collective operation. |
|
|
Broadcasts the tensor to the whole group. |
|
|
NeighborExchangeV2 is a collective communication operation. |
|
|
Operation options for reducing tensors. |
|
|
Reduces and scatters tensors from the specified communication group. |
|
Debugging Operator
API Name |
Description |
Supported Platforms |
Asserts whether the given condition is True. |
|
|
This operator will calculate the histogram of a tensor and put it to a summary file with protocol buffer format. |
|
|
This operator will put an image tensor to a summary file with protocol buffer format. |
|
|
This operator will put a scalar to a summary file with protocol buffer format. |
|
|
This operator will put a tensor to a summary file with protocol buffer format. |
|
|
Print the inputs to stdout. |
|
|
Allocates a flag to store the overflow status. |
|
|
Clears the flag which stores the overflow status. |
|
|
|
|
Sparse Operator
API Name |
Description |
Supported Platforms |
Multiplies sparse matrix A by dense matrix B. |
|
|
Converts a sparse representation into a dense tensor. |
|
Frame Operators
API Name |
Description |
Supported Platforms |
Depend is used for processing dependency operations. |
|
|
A higher-order function which is used to generate the gradient function for the input function. |
|
|
This operation is used as a tag to hook gradient in intermediate variables. |
|
|
Hypermap will apply the set operation to input sequences. |
|
|
Attaches callback to the graph node that will be invoked on the node's gradient. |
|
|
Map will apply the set operation on input sequences. |
|
|
MultitypeFuncGraph is a class used to generate overloaded functions, considering different types as inputs. |
|
|
Makes a partial function instance. |
|
|
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. |
|
Operator Information Registration
Class for AiCPU operator information register. |
|
Class used for generating the registration information for the func parameter of |
|
Various combinations of dtype and format of Ascend ops. |
|
Class for TBE operator information register. |
|
Gets the virtual implementation function by a primitive object or primitive name. |
Customizing Operator
API Name |
Description |
Supported Platforms |
Custom primitive is used for user defined operators and is to enhance the expressive ability of built-in primitives. |
|
Spectral Operator
API Name |
Description |
Supported Platforms |
Bartlett window function. |
|
|
Blackman window function. |
|