• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# OH_NN_Tensor
2
3
4## Overview
5
6Defies the the tensor structure.
7
8It 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.
9
10**Since**: 9
11
12**Deprecated**: This module is deprecated since API version 11.
13
14**Substitute**: You are advised to use [NN_TensorDesc](_neural_network_runtime.md#nn_tensordesc).
15
16**Related module**: [NeuralNetworkRuntime](_neural_network_runtime.md)
17
18
19## Summary
20
21
22### Member Variables
23
24| Name| Description|
25| -------- | -------- |
26| [dataType](#datatype) | Data type of the specified tensor. The value must be of the [OH_NN_DataType](_neural_network_runtime.md#oh_nn_datatype) type.|
27| [dimensionCount](#dimensioncount) | Number of dimensions of the specified tensor.|
28| [dimensions](#dimensions) | Dimension information (shape) of the specified tensor.|
29| [quantParam](#quantparam) | Quantization information of the specified tensor. The data type must be [OH_NN_QuantParam](_o_h___n_n___quant_param.md).|
30| [type](#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](_neural_network_runtime.md). If the tensor is used as an operator parameter, select an enum value other than [OH_NN_TENSOR](_neural_network_runtime.md) from [OH_NN_TensorType](_neural_network_runtime.md#oh_nn_tensortype).|
31
32
33## Member Variable Description
34
35
36### dataType
37
38```
39OH_NN_DataType OH_NN_Tensor::dataType
40```
41
42**Description**
43
44Data type of the specified tensor. The value must be of the [OH_NN_DataType](_neural_network_runtime.md#oh_nn_datatype) type.
45
46
47### dimensionCount
48
49```
50uint32_t OH_NN_Tensor::dimensionCount
51```
52
53**Description**
54
55Number of dimensions of the specified tensor.
56
57
58### dimensions
59
60```
61const int32_t* OH_NN_Tensor::dimensions
62```
63
64**Description**
65
66Dimension information (shape) of the specified tensor.
67
68
69### quantParam
70
71```
72const OH_NN_QuantParam* OH_NN_Tensor::quantParam
73```
74
75**Description**
76
77Quantization information of the specified tensor. The data type must be [OH_NN_QuantParam](_o_h___n_n___quant_param.md).
78
79
80### type
81
82```
83OH_NN_TensorType OH_NN_Tensor::type
84```
85
86**Description**
87
88Type 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](_neural_network_runtime.md). If the tensor is used as an operator parameter, select an enum value other than [OH_NN_TENSOR](_neural_network_runtime.md) from [OH_NN_TensorType](_neural_network_runtime.md#oh_nn_tensortype).
89