• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# OH_NN_Tensor
2<!--Kit: Neural Network Runtime Kit-->
3<!--Subsystem: AI-->
4<!--Owner: @GbuzhidaoR-->
5<!--Designer: @GbuzhidaoR-->
6<!--Tester: @GbuzhidaoR-->
7<!--Adviser: @ge-yafang-->
8
9## Overview
10
11Defines the tensor structure.
12
13It 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.
14
15**Since**: 9
16
17**Deprecated from**: 11
18
19**Substitute**: [NN_TensorDesc](capi-neuralnetworkruntime-nn-tensordesc.md)
20
21**Related module**: [NeuralNetworkRuntime](capi-neuralnetworkruntime.md)
22
23**Header file**: [neural_network_runtime_type.h](capi-neural-network-runtime-type-h.md)
24
25## Summary
26
27### Member Variables
28
29| Name                                                                                 | Description|
30|-------------------------------------------------------------------------------------| -- |
31| [OH_NN_DataType](capi-neural-network-runtime-type-h.md#oh_nn_datatype) dataType     | Data type of the specified tensor. The value must be an enum of [OH_NN_DataType](capi-neural-network-runtime-type-h.md#oh_nn_datatype).|
32| uint32_t dimensionCount                                                             | Number of dimensions of the specified tensor.|
33| const int32_t *dimensions                                                           | Dimension information (shape) of the specified tensor.|
34| const [OH_NN_QuantParam](capi-neuralnetworkruntime-oh-nn-quantparam.md) *quantParam | Quantization information of the specified tensor. The value must be an enum of [OH_NN_QuantParam](capi-neuralnetworkruntime-oh-nn-quantparam.md).|
35| [OH_NN_TensorType](capi-neural-network-runtime-type-h.md#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](capi-neural-network-runtime-type-h.md#oh_nn_tensortype). If the tensor is used as an operator parameter, select an enum value other than [OH_NN_TENSOR](capi-neural-network-runtime-type-h.md#oh_nn_tensortype) from [OH_NN_TensorType](capi-neural-network-runtime-type-h.md#oh_nn_tensortype).|
36