harmony 鸿蒙OH_NN_Tensor

  • 2025-06-12
  • 浏览 (6)

OH_NN_Tensor

Overview

Defies the 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: This module is deprecated since API version 11.

Substitute: You are advised to use NN_TensorDesc.

Related module: NeuralNeworkRuntime

Header file: neural_network_runtime_type.h

Summary

Member Variables

Name Description
OH_NN_DataTypedataType Data type of the specified tensor. The value must be of the OH_NN_DataType type.
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 data type must be OH_NN_QuantParam.
OH_NN_TensorTypetype 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.

Member Variable Description

dataType

OH_NN_DataType OH_NN_Tensor::dataType

Description

Data type of the specified tensor. The value must be of the OH_NN_DataType type.

dimensionCount

uint32_t OH_NN_Tensor::dimensionCount

Description

Number of dimensions of the specified tensor.

dimensions

const int32_t* OH_NN_Tensor::dimensions

Description

Dimension information (shape) of the specified tensor.

quantParam

const OH_NN_QuantParam* OH_NN_Tensor::quantParam

Description

Quantization information of the specified tensor. The data type must be OH_NN_QuantParam.

type

OH_NN_TensorType OH_NN_Tensor::type

Description

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.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Neural Network Runtime Kit

harmony 鸿蒙_neural_network_runtime

harmony 鸿蒙OH_NN_Memory

harmony 鸿蒙OH_NN_QuantParam

harmony 鸿蒙OH_NN_UInt32Array

harmony 鸿蒙neural_network_core.h

harmony 鸿蒙neural_network_runtime.h

harmony 鸿蒙neural_network_runtime_type.h

0  赞