OH_NN_Tensor

typedef struct OH_NN_Tensor {...} OH_NN_Tensor

Overview

Defines the tensor structure.

It is usually used to construct data nodes and operator parameters in a model diagram. When constructing a tensor, you need to specify the data type, number of dimensions, dimension information, and quantization information.

Since: 9

Deprecated from: 11

Substitute: NN_TensorDesc

Related module: NeuralNetworkRuntime

Header file: neural_network_runtime_type.h

Summary

Member Variables

Name Description
OH_NN_DataType dataType Data type of the specified tensor. The value must be an enum of OH_NN_DataType.
uint32_t dimensionCount Number of dimensions of the specified tensor.
const int32_t *dimensions Dimension information (shape) of the specified tensor.
const OH_NN_QuantParam *quantParam Quantization information of the specified tensor. The value must be an enum of OH_NN_QuantParam.
OH_NN_TensorType type Type of the specified tensor. The value is related to the tensor usage. If the tensor is used as the input or output of the model, set type to OH_NN_TENSOR. If the tensor is used as an operator parameter, select an enum value other than OH_NN_TENSOR from OH_NN_TensorType.