harmony 鸿蒙NnrtTypes.idl
NnrtTypes.idl
概述
该文件定义了HDI接口中用到的类型。
Since:
3.2
Version:
2.0
相关模块:
汇总
类
名称 | 描述 |
---|---|
SharedBuffer | struct 共享内存数据的结构体。 |
ModelConfig | struct 定义编译模型需要的参数配置。 |
QuantParam | struct 量化参数结构体。 |
IOTensor | struct AI模型的输入输出张量。 |
枚举
名称 | 描述 |
---|---|
DeviceType : int { OTHER , CPU , GPU , ACCELERATOR } | AI计算芯片的类型。 |
DeviceStatus : int { AVAILABLE , BUSY , OFFLINE , UNKNOWN } | 用于AI计算芯片的状态。 |
PerformanceMode : int {PERFORMANCE_NONE , PERFORMANCE_LOW , PERFORMANCE_MEDIUM , PERFORMANCE_HIGH ,PERFORMANCE_EXTREME } |
芯片执行AI计算的性能模式。 |
Priority : int { PRIORITY_NONE , PRIORITY_LOW , PRIORITY_MEDIUM , PRIORITY_HIGH } | AI计算任务的优先级。 |
Format : byte { FORMAT_NONE = -1 , FORMAT_NCHW = 0 , FORMAT_NHWC = 1 } | 算子数据排布。需要配合Tensor使用。 |
DataType : byte { DATA_TYPE_UNKNOWN = 0 , DATA_TYPE_BOOL = 30 , DATA_TYPE_INT8 = 32 , DATA_TYPE_INT16 = 33 , DATA_TYPE_INT32 = 34 , DATA_TYPE_INT64 = 35 , DATA_TYPE_UINT8 = 37 , DATA_TYPE_UINT16 = 38 , DATA_TYPE_UINT32 = 39 , DATA_TYPE_UINT64 = 40 , DATA_TYPE_FLOAT16 = 42 , DATA_TYPE_FLOAT32 = 43 ,DATA_TYPE_FLOAT64 = 44} |
张量的数据类型。需要配合Tensor使用。 |
QuantType : byte { QUANT_TYPE_NONE , QUANT_TYPE_ALL } | 量化类型。需要配合Node使用。 |
NodeType : unsigned int { NODE_TYPE_NONE = 0 , NODE_TYPE_ACTIVATION = 2 , NODE_TYPE_ADD_FUSION = 5 , NODE_TYPE_ARGMAX_FUSION = 11 , NODE_TYPE_AVGPOOL_FUSION = 17 , NODE_TYPE_BATCH_TO_SPACE_ND = 22 , NODE_TYPE_BIAS_ADD = 23 , NODE_TYPE_CAST = 28 , NODE_TYPE_CONCAT = 31 , NODE_TYPE_CONV2D_FUSION = 35 , NODE_TYPE_CONV2D_TRANSPOSE_FUSION = 36 , NODE_TYPE_DIV_FUSION = 47 , NODE_TYPE_ELTWISE = 52 , NODE_TYPE_EXPAND_DIMS = 56 , NODE_TYPE_FILL = 66 , NODE_TYPE_FULL_CONNECTION = 67 , NODE_TYPE_FUSED_BATCH_NORM = 68 , NODE_TYPE_GATHER = 69 , NODE_TYPE_LAYER_NORM_FUSION = 75 , NODE_TYPE_LESS_EQUAL = 78 , NODE_TYPE_MATMUL_FUSION = 89 , NODE_TYPE_MAXIMUM = 90 , NODE_TYPE_MAX_POOL_FUSION = 92 , NODE_TYPE_MUL_FUSION = 99 , NODE_TYPE_ONE_HOT = 105 , NODE_TYPE_PAD_FUSION = 107 , NODE_TYPE_POW_FUSION = 110 , NODE_TYPE_PRELU_FUSION = 112 , NODE_TYPE_QUANT_DTYPE_CAST = 113 , NODE_TYPE_REDUCE_FUSION = 118 , NODE_TYPE_RESHAPE = 119 , NODE_TYPE_RESIZE = 120 , NODE_TYPE_RSQRT = 126 , NODE_TYPE_SCALE_FUSION = 127 , NODE_TYPE_SHAPE = 130 , NODE_TYPE_SLICE_FUSION = 135 , NODE_TYPE_SOFTMAX = 138 , NODE_TYPE_SPACE_TO_BATCH_ND = 141 , NODE_TYPE_SPLIT = 145 , NODE_TYPE_SQRT = 146 , NODE_TYPE_SQUEEZE = 147 , NODE_TYPE_SQUARED_DIFFERENCE = 149 , NODE_TYPE_STACK = 150 , NODE_TYPE_STRIDED_SLICE = 151 , NODE_TYPE_SUB_FUSION = 152 , NODE_TYPE_TILE_FUSION = 160 , NODE_TYPE_TOPK_FUSION = 161 , NODE_TYPE_TRANSPOSE = 162 , NODE_TYPE_UNSQUEEZE = 165 } |
算子类型。 |
ResizeMethod : byte { RESIZE_METHOD_UNKNOWN = -1 , RESIZE_METHOD_LINEAR = 0 , RESIZE_METHOD_NEAREST = 1 , RESIZE_METHOD_CUBIC = 2 } | 调整尺寸的方法。需要配合Resize算子使用。 |
CoordinateTransformMode : byte { COORDINATE_TRANSFORM_MODE_ASYMMETRIC = 0 , COORDINATE_TRANSFORM_MODE_ALIGN_CORNERS = 1 , COORDINATE_TRANSFORM_MODE_HALF_PIXEL = 2 } | 坐标变换模式,仅Resize算子使用这些枚举。 |
NearestMode : byte { NEAREST_MODE_NORMAL = 0 , NEAREST_MODE_ROUND_HALF_DOWN = 1 , NEAREST_MODE_ROUND_HALF_UP = 2 , NEAREST_MODE_FLOOR = 3 , NEAREST_MODE_CEIL = 4 } |
临近算法类型。需要配合Resize算子使用。 |
ActivationType : byte { ACTIVATION_TYPE_NO_ACTIVATION = 0 , ACTIVATION_TYPE_RELU = 1 , ACTIVATION_TYPE_SIGMOID = 2 , ACTIVATION_TYPE_RELU6 = 3 , ACTIVATION_TYPE_ELU = 4 , ACTIVATION_TYPE_LEAKY_RELU = 5 , ACTIVATION_TYPE_ABS = 6 , ACTIVATION_TYPE_RELU1 = 7 , ACTIVATION_TYPE_SOFTSIGN = 8 , ACTIVATION_TYPE_SOFTPLUS = 9 , ACTIVATION_TYPE_TANH = 10 , ACTIVATION_TYPE_SELU = 11 , ACTIVATION_TYPE_HSWISH = 12 , ACTIVATION_TYPE_HSIGMOID = 13 , ACTIVATION_TYPE_THRESHOLDRELU = 14 , ACTIVATION_TYPE_LINEAR = 15 , ACTIVATION_TYPE_HARD_TANH = 16 , ACTIVATION_TYPE_SIGN = 17 , ACTIVATION_TYPE_SWISH = 18 , ACTIVATION_TYPE_GELU = 19 , ACTIVATION_TYPE_UNKNOWN = 20} |
激活函数类型。 |
ReduceMode : byte { REDUCE_MODE_MEAN = 0 , REDUCE_MODE_MAX = 1 , REDUCE_MODE_MIN = 2 , REDUCE_MODE_PROD = 3 , REDUCE_MODE_SUM = 4 , REDUCE_MODE_SUM_SQUARE = 5 , REDUCE_MODE_ASUM = 6 , REDUCE_MODE_ALL = 7} |
用于维度移除的方法,需要配合ReduceFusion算子使用。 |
EltwiseMode : byte { ELTWISE_MODE_PROD = 0 , ELTWISE_MODE_SUM = 1 , ELTWISE_MODE_MAXIMUM = 2 , ELTWISE_MODE_UNKNOWN = 3 } | 元素级别运算支持的计算类型,需要配合Eltwise算子使用。 |
PadMode : byte { PAD_MODE_PAD = 0 , PAD_MODE_SAME = 1 , PAD_MODE_VALID = 2 } | 填充类型,需要配合AvgPoolFusion,AvgPoolFusion,Conv2DFusion,MaxPoolFusion使用。 |
RoundMode : byte { ROUND_MODE_FLOOR = 0 , ROUND_MODE_CEIL = 1 } | 小数取整算法,需要配合AvgPoolFusion算子使用。 |
PaddingMode : byte { PADDING_MODE_CONSTANT = 0 , PADDING_MODE_REFLECT = 1 , PADDING_MODE_SYMMETRIC = 2 , PADDING_MODE_RESERVED = 3 } | 填充类型,需要配合PadFusion算子使用。 |
NNRT_ReturnCode : int { NNRT_SUCCESS = 0 , NNRT_FAILED = 1 , NNRT_NULL_PTR = 2 , NNRT_INVALID_PARAMETER = 3 , NNRT_MEMORY_ERROR = 4 , NNRT_OUT_OF_MEMORY = 5 , NNRT_OPERATION_FORBIDDEN = 6 , NNRT_INVALID_FILE = 7 , NNRT_INVALID_PATH = 8 , NNRT_INSUFFICIENT_BUFFER = 9 , NNRT_NO_CHANGE = 10 , NNRT_NOT_SUPPORT = 11 , NNRT_SERVICE_ERROR = 12 , NNRT_DEVICE_ERROR = 13 , NNRT_DEVICE_BUSY = 14 , NNRT_CANCELLED = 15 , NNRT_PERMISSION_DENIED = 16 , NNRT_TIME_OUT = 17 , NNRT_INVALID_TENSOR = 18 , NNRT_INVALID_NODE = 19 , NNRT_INVALID_INPUT = 20 , NNRT_INVALID_OUTPUT = 21 , NNRT_INVALID_DATATYPE = 22 , NNRT_INVALID_FORMAT = 23 , NNRT_INVALID_TENSOR_NAME = 24 , NNRT_INVALID_SHAPE = 25 , NNRT_OUT_OF_DIMENTION_RANGES = 26 , NNRT_INVALID_BUFFER = 27 , NNRT_INVALID_BUFFER_SIZE = 28 , NNRT_INVALID_PERFORMANCE_MODE = 29 , NNRT_INVALID_PRIORITY = 30 , NNRT_INVALID_MODEL = 31 , NNRT_INVALID_MODEL_CACHE = 32 , NNRT_UNSUPPORTED_OP = 33 } |
NNRt定义的专用错误码,为HDI接口的返回值。 |
关键字
名称 | 描述 |
---|---|
package ohos.hdi.nnrt.v2_0 | NNRt模块的包路径。 |
你可能感兴趣的鸿蒙文章
harmony 鸿蒙ActivityRecognitionTypes.idl
0
赞
- 所属分类: 后端技术
- 本文标签:
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦