diff --git a/interfaces/kits/c/neural_network_runtime/neural_network_runtime_type.h b/interfaces/kits/c/neural_network_runtime/neural_network_runtime_type.h index a60ead7704fc4637d5a882ed8bbfb30a604ea775..82128d1a38fc13beea954d4e881f2896672af92a 100644 --- a/interfaces/kits/c/neural_network_runtime/neural_network_runtime_type.h +++ b/interfaces/kits/c/neural_network_runtime/neural_network_runtime_type.h @@ -276,6 +276,23 @@ typedef enum { OH_NN_ACCELERATOR = 3, } OH_NN_DeviceType; +/** + * @brief Defines the padding mode. + * + * @since 12 + * @version 1.0 + */ +typedef enum { + /** Padding Constant. */ + OH_NN_PADDING_CONSTANT = 0, + /** Padding Reflect */ + OH_NN_PADDING_REFLECT = 1, + /** Padding Replicate */ + OH_NN_PADDING_SYMMETRIC = 2, + /** Padding Circular */ + OH_NN_PADDING_RESERVED = 3 +} OH_NN_PaddingMode; + /** * @brief Defines tensor data types. * @@ -743,7 +760,7 @@ typedef enum { * * Outputs: * - * * output: computing result, which has the same data type and shape of output and input1. + * * output: computing result, which has the same data type and shape of input1 and input2. */ OH_NN_OPS_ELTWISE = 12, @@ -1703,7 +1720,7 @@ typedef enum { * Parameters: * * base: The base of exponential function, default -1 for a value of e, must be > 0. * * scale: The amplifcation factor of independent value, default 1. - * * shift: The offset of independent value, default 1. + * * shift: The offset of independent value, default 0. * * Outputs: * * output: A tensor. The exponential of the input tensor computed element-wise. @@ -1787,12 +1804,11 @@ typedef enum { * in the following order: depth, column, and then row. * * Inputs: - * * input: 4-dimensional tensor.. with specific format of NHWC or NCHW. + * * input: 4-dimensional tensor with specific format of NHWC or NCHW. * where N is the batch axis, H is the height, W is the width and C is the channel or depth. * * Parameters: * * blockSize: Blocks of [blocksize, blocksize] are moved. - * * format: Format of input tensor, default NCHW. * * mode: DCR (default) for depth-column-row order re-arrangement. Use CRD for column-row-depth order. * * Outputs: @@ -1809,7 +1825,6 @@ typedef enum { * * input: n-dimensional tensor. * * Parameters: - * * dType: Reserved dataType parameter. * * start: Scalar. First entry for the range of output values. * * limit: Scalar. Exclusive upper limit for the range of output values. * * delta: Scalar. Value to step by. @@ -1847,7 +1862,7 @@ typedef enum { * If empty tensor is given, the output would be a scalar. All values must be >= 0. * * Parameters: - * * dataType: The data_type of the output tensor. + * * dataType: The data type of the output tensor. * * value: The value of the output elements. Should be a one-element tensor. * * Outputs: @@ -1930,7 +1945,7 @@ typedef enum { * * input: n-dimensional input tensor. * * Parameters: - * * negative_slope: Coefficient of leakage. + * * negativeSlope: Coefficient of leakage. * * Outputs: * * output: A tensor, with the same data type and shape as the input tensor. @@ -1941,15 +1956,15 @@ typedef enum { * Computes an one-layer LSTM. This operator is usually supported via some custom implementation. * * Inputs: - * * input: n-dimensional tensor, shape is [seq_len, batch_size, input_size]. + * * input: n-dimensional tensor, shape is [seqLen, batchSize, inputSize]. * * wIh: Weight tensor of input-layer to hidden-layer, - * shape is [num_directions* num_layers, 4 * hidden_size, input_size]. + * shape is [numDirections* numLayers, 4 * hiddenSize, inputSize]. * * wHh: Weight tensor of hidden-layer to hidden-layer, - * shape is [num_directions* num_layers, 4 * hidden_size, hidden_size]. + * shape is [numDirections* numLayers, 4 * hiddenSize, hiddenSize]. * * bias: Bias tensor of input-layer and hidden-layer to hidden-layer, - * shape is [num_directions* num_layers, 8 * hidden_size]. - * * hx: Init state of hidden-layer, shape is [num_directions * num_layers, batch_size, hidden_size]. - * * cx: Init state of cell, shape is [num_directions * num_layers, batch_size, hidden_size]. + * shape is [numDirections* numLayers, 8 * hiddenSize]. + * * hx: Init state of hidden-layer, shape is [numDirections * numLayers, batchSize, hiddenSize]. + * * cx: Init state of cell, shape is [numDirections * numLayers, batchSize, hiddenSize]. * * Parameters: * * bidirectional: Whether the LSTM operation is bidirectional. @@ -1961,15 +1976,15 @@ typedef enum { * * dropout: Dropout probalility of each layer except first-layer. * * zoneoutCell: Probalility that the cell state retains the previous state. Default: 0. * * zoneoutHidden: Probalility that the hidden state retains the previous state. Default: 0. - * * projSize: If proj_size > 0, will use LSTM with projections of corresponding size. Default: 0. + * * projSize: If projSize > 0, will use LSTM with projections of corresponding size. Default: 0. * * Outputs: * * output: A tensor that concats all the intermediate output tensor of the hidden, - * shape is [seq_len, batch_size, num_directions * real_hidden_size]. + * shape is [seqLen, batchSize, numDirections * realHiddenSize]. * * hy: The last output tensor of the hidden-layer, - * shape is [num_directions * num_layers, batch_size, real_hidden_size]. + * shape is [numDirections * numLayers, batchSize, realHiddenSize]. * * cy: The last output tensor of the cell, - * shape is [num_directions * num_layers, batch_size, hidden_size]. + * shape is [numDirections * numLayers, batchSize, hiddenSize]. */ OH_NN_OPS_LSTM = 75, @@ -1999,7 +2014,7 @@ typedef enum { * * aixs: scalar or tensor, indices the dimension to be computed. * * Parameters: - * * keep_dims: Whether to keep dimension info. + * * keepDims: Whether to keep dimension info. * * Outputs: * * output: Indices or values before the maximum input tensor on the axis. @@ -2046,11 +2061,11 @@ typedef enum { OH_NN_OPS_LOG = 80, /** - * Calculates the truth value of input0 and input1 element-wise. + * Calculates the truth value of input1 and input2 element-wise. * * Inputs: - * * input0: Tensor of type boolean or convert to boolean implicitly. * * input1: Tensor of type boolean or convert to boolean implicitly. + * * input2: Tensor of type boolean or convert to boolean implicitly. * * Outputs: * * output: A tensor of type bool with the shape that x1 and x2 broadcast to. @@ -2070,15 +2085,15 @@ typedef enum { /** * Computes the remainder of dividing the first input tensor by the second input tensor element-wise. - * Inputs of x and y comply with the implicit type conversion rules to make the data types consistent. + * Inputs of input1 and input2 comply with the implicit type conversion rules to make the data types consistent. * The inputs must be two tensors or one tensor and one scalar. When the inputs are two tensors, * both dtypes cannot be bool, and the shapes of them could be broadcast. * When the inputs are one tensor and one scalar, the scalar could only be a constant. * * Inputs: - * * input0: A number, a bool or a tensor whose data type is number. - * * input1:if input0 is a tensor, input1 could be a number, a bool or a tensor whose data type is number. - * If input0 is a number or a bool, input1 must be a tensor whose data type is number. + * * input1: A number, a bool or a tensor whose data type is number. + * * input2:if input1 is a tensor, input2 could be a number, a bool or a tensor whose data type is number. + * If input1 is a number or a bool, input2 must be a tensor whose data type is number. * * Outputs: * * output: The shape is the same shape as the boradcast shape. The data type is the type with @@ -2123,14 +2138,14 @@ typedef enum { * Selects elements from x1 or x2 based on condition and returns a tensor. * * Inputs: - * * input_cond: n-dimensional tensor or scalar. + * * condition: n-dimensional tensor or scalar. * The condition tensor, decides which element is chosen. * * input1: n-dimensional tensor. If condition is rank 1, * x1 may have higher rank, but its first dimension must match the size of condition. * * input2: n-dimensional tensor. * * Outputs: - * * output: A tensor, has the same shape as the input_cond. + * * output: A tensor, has the same shape as the condition. */ OH_NN_OPS_WHERE = 87, @@ -2150,14 +2165,14 @@ typedef enum { OH_NN_OPS_SPARSE_TO_DENSE = 88, /** - * Calculates the truth value of input0 or input1 element-wise. + * Calculates the truth value of input1 or input2 element-wise. * * Inputs: - * * input0: Tensor of type boolean or convert to boolean implicitly. * * input1: Tensor of type boolean or convert to boolean implicitly. + * * input2: Tensor of type boolean or convert to boolean implicitly. * * Outputs: - * * output: A tensor of type bool with the shape that input0 and input1 broadcast to. + * * output: A tensor of type bool with the shape that input1 and input2 broadcast to. */ OH_NN_OPS_LOGICAL_OR = 89, } OH_NN_OperationType; @@ -2184,18 +2199,18 @@ typedef enum { * of the Add operator. */ OH_NN_ADD_ACTIVATIONTYPE = 1, - /** This enumerated value is used when the tensor is used as the kernel_size parameter + /** This enumerated value is used when the tensor is used as the kernelSize parameter * of the AvgPool operator. */ OH_NN_AVG_POOL_KERNEL_SIZE = 2, /** This enumerated value is used when the tensor is used as the stride parameter * of the AvgPool operator. */ OH_NN_AVG_POOL_STRIDE = 3, - /** This enumerated value is used when the tensor is used as the pad_mode parameter + /** This enumerated value is used when the tensor is used as the padMode parameter * of the AvgPool operator. */ OH_NN_AVG_POOL_PAD_MODE = 4, /** This enumerated value is used when the tensor is used as the pad parameter of the AvgPool operator. */ OH_NN_AVG_POOL_PAD = 5, - /** This enumerated value is used when the tensor is used as the activation_type parameter + /** This enumerated value is used when the tensor is used as the activationType parameter * of the AvgPool operator. */ OH_NN_AVG_POOL_ACTIVATION_TYPE = 6, @@ -2292,18 +2307,18 @@ typedef enum { * of the Matmul operator. */ OH_NN_MATMUL_ACTIVATION_TYPE = 35, - /** This enumerated value is used when the tensor is used as the kernel_size parameter + /** This enumerated value is used when the tensor is used as the kernelSize parameter * of the MaxPool operator. */ OH_NN_MAX_POOL_KERNEL_SIZE = 36, /** This enumerated value is used when the tensor is used as the stride parameter * of the MaxPool operator. */ OH_NN_MAX_POOL_STRIDE = 37, - /** This enumerated value is used when the tensor is used as the pad_mode parameter + /** This enumerated value is used when the tensor is used as the padMode parameter * of the MaxPool operator. */ OH_NN_MAX_POOL_PAD_MODE = 38, /** This enumerated value is used when the tensor is used as the pad parameter of the MaxPool operator. */ OH_NN_MAX_POOL_PAD = 39, - /** This enumerated value is used when the tensor is used as the activation_type parameter + /** This enumerated value is used when the tensor is used as the activationType parameter * of the MaxPool operator. */ OH_NN_MAX_POOL_ACTIVATION_TYPE = 40, @@ -2314,7 +2329,7 @@ typedef enum { /** This enumerated value is used when the tensor is used as the axis parameter of the OneHot operator. */ OH_NN_ONE_HOT_AXIS = 42, - /** This enumerated value is used when the tensor is used as the constant_value parameter + /** This enumerated value is used when the tensor is used as the constantValue parameter * of the Pad operator. */ OH_NN_PAD_CONSTANT_VALUE = 43, @@ -2369,23 +2384,23 @@ typedef enum { * of the Sub operator. */ OH_NN_SUB_ACTIVATIONTYPE = 59, - /** This enumerated value is used when the tensor is used as the keep_dims parameter + /** This enumerated value is used when the tensor is used as the keepDims parameter * of the ReduceMean operator. */ OH_NN_REDUCE_MEAN_KEEP_DIMS = 60, - /** This enumerated value is used when the tensor is used as the new_height parameter + /** This enumerated value is used when the tensor is used as the newHeight parameter * of the ResizeBilinear operator. */ OH_NN_RESIZE_BILINEAR_NEW_HEIGHT = 61, - /** This enumerated value is used when the tensor is used as the new_width parameter + /** This enumerated value is used when the tensor is used as the newWidth parameter * of the ResizeBilinear operator. */ OH_NN_RESIZE_BILINEAR_NEW_WIDTH = 62, - /** This enumerated value is used when the tensor is used as the preserve_aspect_ratio parameter + /** This enumerated value is used when the tensor is used as the preserveAspectRatio parameter * of the ResizeBilinear operator. */ OH_NN_RESIZE_BILINEAR_PRESERVE_ASPECT_RATIO = 63, - /** This enumerated value is used when the tensor is used as the coordinate_transform_mode parameter + /** This enumerated value is used when the tensor is used as the coordinateTransformMode parameter * of the ResizeBilinear operator. */ OH_NN_RESIZE_BILINEAR_COORDINATE_TRANSFORM_MODE = 64, - /** This enumerated value is used when the tensor is used as the exclude_outside parameter + /** This enumerated value is used when the tensor is used as the excludeOutside parameter * of the ResizeBilinear operator. */ OH_NN_RESIZE_BILINEAR_EXCLUDE_OUTSIDE = 65, @@ -2402,11 +2417,11 @@ typedef enum { * of the LayerNorm operator. */ OH_NN_LAYER_NORM_ELEMENTWISE_AFFINE = 69, - /** This enumerated value is used when the tensor is used as the keep_dims parameter + /** This enumerated value is used when the tensor is used as the keepDims parameter * of the ReduceProd operator. */ OH_NN_REDUCE_PROD_KEEP_DIMS = 70, - /** This enumerated value is used when the tensor is used as the keep_dims parameter + /** This enumerated value is used when the tensor is used as the keepDims parameter * of the ReduceAll operator. */ OH_NN_REDUCE_ALL_KEEP_DIMS = 71, @@ -2438,96 +2453,91 @@ typedef enum { /** This enumerated value is used when the tensor is used as the axis parameter of the Flatten operator. */ OH_NN_FLATTEN_AXIS = 79, - /** This enumerated value is used when the tensor is used as the block_Size parameter + /** This enumerated value is used when the tensor is used as the blockSize parameter * of the DepthToSpace operator. */ OH_NN_DEPTH_TO_SPACE_BLOCK_SIZE = 80, - /** This enumerated value is used when the tensor is used as the format parameter - * of the DepthToSpace operator. */ - OH_NN_DEPTH_TO_SPACE_FORMAT = 81, /** This enumerated value is used when the tensor is used as the mode parameter * of the DepthToSpace operator. */ - OH_NN_DEPTH_TO_SPACE_MODE = 82, + OH_NN_DEPTH_TO_SPACE_MODE = 81, - /** This enumerated value is used when the tensor is used as the dType parameter of the Range operator. */ - OH_NN_RANGE_DTYPE = 83, /** This enumerated value is used when the tensor is used as the start parameter of the Range operator. */ - OH_NN_RANGE_START = 84, + OH_NN_RANGE_START = 82, /** This enumerated value is used when the tensor is used as the limit parameter of the Range operator. */ - OH_NN_RANGE_LIMIT = 85, + OH_NN_RANGE_LIMIT = 83, /** This enumerated value is used when the tensor is used as the delta parameter of the Range operator. */ - OH_NN_RANGE_DELTA = 86, + OH_NN_RANGE_DELTA = 84, /** This enumerated value is used when the tensor is used as the dataType parameter * of the ConstantOfShape operator. */ - OH_NN_CONSTANT_OF_SHAPE_DATA_TYPE = 87, + OH_NN_CONSTANT_OF_SHAPE_DATA_TYPE = 85, /** This enumerated value is used when the tensor is used as the value parameter * of the ConstantOfShape operator. */ - OH_NN_CONSTANT_OF_SHAPE_VALUE = 88, + OH_NN_CONSTANT_OF_SHAPE_VALUE = 86, /** This enumerated value is used when the tensor is used as the shape parameter * of the BroadcastTo operator. */ - OH_NN_BROADCAST_TO_SHAPE = 89, + OH_NN_BROADCAST_TO_SHAPE = 87, /** This enumerated value is used when the tensor is used as the epsilon parameter * of the InstanceNorm operator. */ - OH_NN_INSTANCE_NORM_EPSILON = 90, + OH_NN_INSTANCE_NORM_EPSILON = 88, /** This enumerated value is used when the tensor is used as the base parameter of the Exp operator. */ - OH_NN_EXP_BASE = 91, + OH_NN_EXP_BASE = 89, /** This enumerated value is used when the tensor is used as the scale parameter of the Exp operator. */ - OH_NN_EXP_SCALE = 92, + OH_NN_EXP_SCALE = 90, /** This enumerated value is used when the tensor is used as the shift parameter of the Exp operator. */ - OH_NN_EXP_SHIFT = 93, + OH_NN_EXP_SHIFT = 91, - /** This enumerated value is used when the tensor is used as the negative_slope parameter + /** This enumerated value is used when the tensor is used as the negativeSlope parameter * of the LeakyRelu operator. */ - OH_NN_LEAKY_RELU_NEGATIVE_SLOPE = 94, + OH_NN_LEAKY_RELU_NEGATIVE_SLOPE = 92, /** This enumerated value is used when the tensor is used as the bidirectional parameter * of the LSTM operator. */ - OH_NN_LSTM_BIDIRECTIONAL = 95, - /** This enumerated value is used when the tensor is used as the has_bias parameter of the LSTM operator. */ - OH_NN_LSTM_HAS_BIAS = 96, - /** This enumerated value is used when the tensor is used as the input_size parameter + OH_NN_LSTM_BIDIRECTIONAL = 93, + /** This enumerated value is used when the tensor is used as the hasBias parameter of the LSTM operator. */ + OH_NN_LSTM_HAS_BIAS = 94, + /** This enumerated value is used when the tensor is used as the inputSize parameter * of the LSTM operator. */ - OH_NN_LSTM_INPUT_SIZE = 97, - /** This enumerated value is used when the tensor is used as the hidden_size parameter + OH_NN_LSTM_INPUT_SIZE = 95, + /** This enumerated value is used when the tensor is used as the hiddenSize parameter * of the LSTM operator. */ - OH_NN_LSTM_HIDDEN_SIZE = 98, - /** This enumerated value is used when the tensor is used as the num_layers parameter + OH_NN_LSTM_HIDDEN_SIZE = 96, + /** This enumerated value is used when the tensor is used as the numLayers parameter * of the LSTM operator. */ - OH_NN_LSTM_NUM_LAYERS = 99, - /** This enumerated value is used when the tensor is used as the num_directions parameter + OH_NN_LSTM_NUM_LAYERS = 97, + /** This enumerated value is used when the tensor is used as the numDirections parameter * of the LSTM operator. */ - OH_NN_LSTM_NUM_DIRECTIONS = 100, + OH_NN_LSTM_NUM_DIRECTIONS = 98, /** This enumerated value is used when the tensor is used as the dropout parameter of the LSTM operator. */ - OH_NN_LSTM_DROPOUT = 101, - /** This enumerated value is used when the tensor is used as the zoneout_cell parameter + OH_NN_LSTM_DROPOUT = 99, + /** This enumerated value is used when the tensor is used as the zoneoutCell parameter * of the LSTM operator. */ - OH_NN_LSTM_ZONEOUT_CELL = 102, - /** This enumerated value is used when the tensor is used as the zoneout_hidden parameter + OH_NN_LSTM_ZONEOUT_CELL = 100, + /** This enumerated value is used when the tensor is used as the zoneoutHidden parameter * of the LSTM operator. */ - OH_NN_LSTM_ZONEOUT_HIDDEN = 103, - /** This enumerated value is used when the tensor is used as the proj_size parameter + OH_NN_LSTM_ZONEOUT_HIDDEN = 101, + /** This enumerated value is used when the tensor is used as the projSize parameter * of the LSTM operator. */ - OH_NN_LSTM_PROJ_SIZE = 104, + OH_NN_LSTM_PROJ_SIZE = 102, /** This enumerated value is used when the tensor is used as the max parameter of the Clip operator. */ - OH_NN_CLIP_MAX = 105, + OH_NN_CLIP_MAX = 103, /** This enumerated value is used when the tensor is used as the min parameter of the Clip operator. */ - OH_NN_CLIP_MIN = 106, + OH_NN_CLIP_MIN = 104, - /** This enumerated value is used when the tensor is used as the keep_dims parameter of the All operator. */ - OH_NN_ALL_KEEP_DIMS = 107, + /** This enumerated value is used when the tensor is used as the keepDims parameter of the All operator. */ + OH_NN_ALL_KEEP_DIMS = 105, /** This enumerated value is used when the tensor is used as the summarize parameter * of the Assert operator. */ - OH_NN_ASSERT_SUMMARIZE = 108, + OH_NN_ASSERT_SUMMARIZE = 106, /** This enumerated value is used when the tensor is used as the scale parameter of the pow operator. */ - OH_NN_POW_SCALE = 109, + OH_NN_POW_SCALE = 107, /** This enumerated value is used when the tensor is used as the shift parameter of the pow operator. */ - OH_NN_POW_SHIFT = 110, + OH_NN_POW_SHIFT = 108, } OH_NN_TensorType; /**