ArmNN
 24.02
Converter Class Reference

#include <Converter.hpp>

Public Types

using Model = ::android::nn::Model
 
using Operand = ::android::nn::Operand
 
using OperandLifeTime = ::android::nn::Operand::LifeTime
 
using OperandType = ::android::nn::OperandType
 
using Operation = ::android::nn::Operation
 
using OperationType = ::android::nn::OperationType
 
using ErrorStatus = ::android::nn::ErrorStatus
 

Static Public Member Functions

static bool ConvertOperation (const Operation &operation, const Model &model, ConversionData &data)
 

Detailed Description

Definition at line 20 of file Converter.hpp.

Member Typedef Documentation

◆ ErrorStatus

using ErrorStatus = ::android::nn::ErrorStatus

Definition at line 30 of file Converter.hpp.

◆ Model

using Model = ::android::nn::Model

Definition at line 24 of file Converter.hpp.

◆ Operand

using Operand = ::android::nn::Operand

Definition at line 25 of file Converter.hpp.

◆ OperandLifeTime

using OperandLifeTime = ::android::nn::Operand::LifeTime

Definition at line 26 of file Converter.hpp.

◆ OperandType

using OperandType = ::android::nn::OperandType

Definition at line 27 of file Converter.hpp.

◆ Operation

using Operation = ::android::nn::Operation

Definition at line 28 of file Converter.hpp.

◆ OperationType

using OperationType = ::android::nn::OperationType

Definition at line 29 of file Converter.hpp.

Member Function Documentation

◆ ConvertOperation()

bool ConvertOperation ( const Operation operation,
const Model model,
ConversionData data 
)
static

Definition at line 22 of file Converter.cpp.

23 {
24  switch (operation.type)
25  {
26  case OperationType::ABS:
27  return ConvertElementwiseUnary(operation, model, data, UnaryOperation::Abs);
28  case OperationType::ADD:
29  return ConvertElementwiseBinary(operation, model, data, armnn::BinaryOperation::Add);
30  case OperationType::ARGMAX:
31  return ConvertArgMinMax(operation, model, data, ArgMinMaxFunction::Max);
32  case OperationType::ARGMIN:
33  return ConvertArgMinMax(operation, model, data, ArgMinMaxFunction::Min);
34  case OperationType::AVERAGE_POOL_2D:
35  return ConvertAveragePool2d(operation, model, data);
36  case OperationType::BATCH_MATMUL:
37  return ConvertBatchMatMul(operation, model, data);
38  case OperationType::BATCH_TO_SPACE_ND:
39  return ConvertBatchToSpaceNd(operation, model, data);
40  case OperationType::CAST:
41  return ConvertCast(operation, model, data);
42  case OperationType::CONCATENATION:
43  return ConvertConcatenation(operation, model, data);
44  case OperationType::CONV_2D:
45  return ConvertConv2d(operation, model, data);
46  case OperationType::DEPTH_TO_SPACE:
47  return ConvertDepthToSpace(operation, model, data);
48  case OperationType::DEPTHWISE_CONV_2D:
49  return ConvertDepthwiseConv2d(operation, model, data);
50  case OperationType::DEQUANTIZE:
51  return ConvertDequantize(operation, model, data);
52  case OperationType::DIV:
53  return ConvertElementwiseBinary(operation, model, data, armnn::BinaryOperation::Div);
54  case OperationType::ELU:
55  return ConvertElu(operation, model, data);
56  case OperationType::EQUAL:
57  return ConvertComparison(operation, model, data, ComparisonOperation::Equal);
58  case OperationType::EXP:
59  return ConvertElementwiseUnary(operation, model, data, UnaryOperation::Exp);
60  case OperationType::EXPAND_DIMS:
61  return ConvertExpandDims(operation, model, data);
62  case OperationType::FILL:
63  return ConvertFill(operation, model, data);
64  case OperationType::FLOOR:
65  return ConvertFloor(operation, model, data);
66  case OperationType::FULLY_CONNECTED:
67  return ConvertFullyConnected(operation, model, data);
68  case OperationType::GATHER:
69  return ConvertGather(operation, model, data);
70  case OperationType::GREATER:
71  return ConvertComparison(operation, model, data, ComparisonOperation::Greater);
72  case OperationType::GREATER_EQUAL:
73  return ConvertComparison(operation, model, data, ComparisonOperation::GreaterOrEqual);
74  case OperationType::GROUPED_CONV_2D:
75  return ConvertGroupedConv2d(operation, model, data);
76  case OperationType::HARD_SWISH:
77  return ConvertHardSwish(operation, model, data);
78  case OperationType::INSTANCE_NORMALIZATION:
79  return ConvertInstanceNormalization(operation, model, data);
80  case OperationType::L2_NORMALIZATION:
81  return ConvertL2Normalization(operation, model, data);
82  case OperationType::L2_POOL_2D:
83  return ConvertL2Pool2d(operation, model, data);
84  case OperationType::LESS:
85  return ConvertComparison(operation, model, data, ComparisonOperation::Less);
86  case OperationType::LESS_EQUAL:
87  return ConvertComparison(operation, model, data, ComparisonOperation::LessOrEqual);
88  case OperationType::LOCAL_RESPONSE_NORMALIZATION:
89  return ConvertLocalResponseNormalization(operation, model, data);
90  case OperationType::LOG:
91  return ConvertElementwiseUnary(operation, model, data, UnaryOperation::Log);
92  case OperationType::LOGICAL_AND:
93  return ConvertLogicalBinary(operation, model, data, LogicalBinaryOperation::LogicalAnd);
94  case OperationType::LOGICAL_NOT:
95  return ConvertElementwiseUnary(operation, model, data, UnaryOperation::LogicalNot);
96  case OperationType::LOGICAL_OR:
97  return ConvertLogicalBinary(operation, model, data, LogicalBinaryOperation::LogicalOr);
98  case OperationType::LOGISTIC:
99  return ConvertLogistic(operation, model, data);
100  case OperationType::LOG_SOFTMAX:
101  return ConvertLogSoftmax(operation, model, data);
102  case OperationType::LSTM:
103  return ConvertLstm(operation, model, data);
104  case OperationType::MAX_POOL_2D:
105  return ConvertMaxPool2d(operation, model, data);
106  case OperationType::MAXIMUM:
107  return ConvertElementwiseBinary(operation, model, data, armnn::BinaryOperation::Maximum);
108  case OperationType::MEAN:
109  return ConvertMean(operation, model, data);
110  case OperationType::MINIMUM:
111  return ConvertElementwiseBinary(operation, model, data, armnn::BinaryOperation::Minimum);
112  case OperationType::MUL:
113  return ConvertElementwiseBinary(operation, model, data, armnn::BinaryOperation::Mul);
114  case OperationType::NEG:
115  return ConvertElementwiseUnary(operation, model, data, UnaryOperation::Neg);
116  case OperationType::NOT_EQUAL:
117  return ConvertComparison(operation, model, data, ComparisonOperation::NotEqual);
118  case OperationType::PAD:
119  return ConvertPad(operation, model, data);
120  case OperationType::PAD_V2:
121  return ConvertPadV2(operation, model, data);
122  case OperationType::PRELU:
123  return ConvertPrelu(operation, model, data);
124  case OperationType::POW:
125  return ConvertElementwiseBinary(operation, model, data, BinaryOperation::Power);
126  case OperationType::QUANTIZE:
127  return ConvertQuantize(operation, model, data);
128  case OperationType::QUANTIZED_LSTM:
129  return ConvertQuantizedLstm(operation, model, data);
130  case OperationType::QUANTIZED_16BIT_LSTM:
131  return ConvertQuantized16BitLstm(operation, model, data);
132  case OperationType::RANK:
133  return ConvertRank(operation, model, data);
134  case OperationType::REDUCE_MAX:
135  return ConvertReduce(operation, model, data, armnn::ReduceOperation::Max);
136  case OperationType::REDUCE_MIN:
137  return ConvertReduce(operation, model, data, armnn::ReduceOperation::Min);
138  case OperationType::REDUCE_PROD:
139  return ConvertReduce(operation, model, data, armnn::ReduceOperation::Prod);
140  case OperationType::REDUCE_SUM:
141  return ConvertReduce(operation, model, data, armnn::ReduceOperation::Sum);
142  case OperationType::RELU:
143  return ConvertReLu(operation, model, data);
144  case OperationType::RELU1:
145  return ConvertReLu1(operation, model, data);
146  case OperationType::RELU6:
147  return ConvertReLu6(operation, model, data);
148  case OperationType::RESHAPE:
149  return ConvertReshape(operation, model, data);
150  case OperationType::RESIZE_BILINEAR:
151  return ConvertResize(operation, model, data, ResizeMethod::Bilinear);
152  case OperationType::RESIZE_NEAREST_NEIGHBOR:
153  return ConvertResize(operation, model, data, ResizeMethod::NearestNeighbor);
154  case OperationType::REVERSE:
155  return ConvertReverseV2(operation, model, data);
156  case OperationType::RSQRT:
157  return ConvertElementwiseUnary(operation, model, data, UnaryOperation::Rsqrt);
158  case OperationType::SIN:
159  return ConvertElementwiseUnary(operation, model, data, UnaryOperation::Sin);
160  case OperationType::SOFTMAX:
161  return ConvertSoftmax(operation, model, data);
162  case OperationType::SPACE_TO_BATCH_ND :
163  return ConvertSpaceToBatchNd(operation, model, data);
164  case OperationType::SPACE_TO_DEPTH:
165  return ConvertSpaceToDepth(operation, model, data);
166  case OperationType::SQRT:
167  return ConvertSqrt(operation, model, data);
168  case OperationType::SQUEEZE:
169  return ConvertSqueeze(operation, model, data);
170  case OperationType::STRIDED_SLICE:
171  return ConvertStridedSlice(operation, model, data);
172  case OperationType::SUB:
173  return ConvertElementwiseBinary(operation, model, data, BinaryOperation::Sub);
174  case OperationType::TILE:
175  return ConvertTile(operation, model, data);
176  case OperationType::TRANSPOSE:
177  return ConvertTranspose(operation, model, data);
178  case OperationType::TRANSPOSE_CONV_2D:
179  return ConvertTransposeConv2d(operation, model, data);
180  case OperationType::TANH:
181  return ConvertTanH(operation, model, data);
182  default:
183  VLOG(DRIVER) << "Operation type: " << operation.type << "is not supported in ArmnnDriver";
184  return false;
185  }
186 }

References armnn::Add, armnn_driver::ConvertReduce(), armnn::Div, armnn::Max, armnn::Maximum, armnn::Min, armnn::Minimum, armnn::Mul, armnn::Prod, and armnn::Sum.


The documentation for this class was generated from the following files:
armnn::BinaryOperation::Mul
@ Mul
armnn::BinaryOperation::Add
@ Add
armnn::BinaryOperation::Maximum
@ Maximum
armnn::ReduceOperation::Sum
@ Sum
armnn::ReduceOperation::Prod
@ Prod
armnn::BinaryOperation::Minimum
@ Minimum
armnn_driver::ConvertReduce
bool ConvertReduce(const Operation &operation, const Model &model, ConversionData &data, armnn::ReduceOperation reduceOperation)
Definition: ConversionUtils.cpp:520
armnn::ReduceOperation::Min
@ Min
armnn::BinaryOperation::Div
@ Div
armnn::ReduceOperation::Max
@ Max