1 // Generated file (from: strided_slice_relaxed.mod.py). Do not edit
CreateModel(Model * model)2 void CreateModel(Model *model) {
3 OperandType type2(Type::INT32, {});
4 OperandType type3(Type::TENSOR_FLOAT32, {1, 2});
5 OperandType type0(Type::TENSOR_FLOAT32, {2, 3});
6 OperandType type1(Type::TENSOR_INT32, {2});
7 // Phase 1, operands
8 auto input = model->addOperand(&type0);
9 auto begins = model->addOperand(&type1);
10 auto ends = model->addOperand(&type1);
11 auto strides = model->addOperand(&type1);
12 auto beginMask = model->addOperand(&type2);
13 auto endMask = model->addOperand(&type2);
14 auto shrinkAxisMask = model->addOperand(&type2);
15 auto output = model->addOperand(&type3);
16 // Phase 2, operations
17 static int32_t begins_init[] = {0, 0};
18 model->setOperandValue(begins, begins_init, sizeof(int32_t) * 2);
19 static int32_t ends_init[] = {2, 3};
20 model->setOperandValue(ends, ends_init, sizeof(int32_t) * 2);
21 static int32_t strides_init[] = {2, 2};
22 model->setOperandValue(strides, strides_init, sizeof(int32_t) * 2);
23 static int32_t beginMask_init[] = {0};
24 model->setOperandValue(beginMask, beginMask_init, sizeof(int32_t) * 1);
25 static int32_t endMask_init[] = {0};
26 model->setOperandValue(endMask, endMask_init, sizeof(int32_t) * 1);
27 static int32_t shrinkAxisMask_init[] = {0};
28 model->setOperandValue(shrinkAxisMask, shrinkAxisMask_init, sizeof(int32_t) * 1);
29 model->addOperation(ANEURALNETWORKS_STRIDED_SLICE, {input, begins, ends, strides, beginMask, endMask, shrinkAxisMask}, {output});
30 // Phase 3, inputs and outputs
31 model->identifyInputsAndOutputs(
32 {input},
33 {output});
34 // Phase 4: set relaxed execution
35 model->relaxComputationFloat32toFloat16(true);
36 assert(model->isValid());
37 }
38
is_ignored(int i)39 bool is_ignored(int i) {
40 static std::set<int> ignore = {};
41 return ignore.find(i) != ignore.end();
42 }
43