1 // clang-format off
2 // Generated file (from: pad_v2_1_quant8.mod.py). Do not edit
CreateModel(Model * model)3 void CreateModel(Model *model) {
4   OperandType type0(Type::TENSOR_QUANT8_ASYMM, {1, 2, 3, 1}, 2.3f, 4);
5   OperandType type1(Type::TENSOR_INT32, {4, 2});
6   OperandType type2(Type::INT32, {});
7   OperandType type3(Type::TENSOR_QUANT8_ASYMM, {1, 4, 7, 1}, 2.3f, 4);
8   // Phase 1, operands
9   auto input0 = model->addOperand(&type0);
10   auto paddings = model->addOperand(&type1);
11   auto pad_value = model->addOperand(&type2);
12   auto output0 = model->addOperand(&type3);
13   // Phase 2, operations
14   static int32_t paddings_init[] = {0, 0, 0, 2, 1, 3, 0, 0};
15   model->setOperandValue(paddings, paddings_init, sizeof(int32_t) * 8);
16   static int32_t pad_value_init[] = {9};
17   model->setOperandValue(pad_value, pad_value_init, sizeof(int32_t) * 1);
18   model->addOperation(ANEURALNETWORKS_PAD_V2, {input0, paddings, pad_value}, {output0});
19   // Phase 3, inputs and outputs
20   model->identifyInputsAndOutputs(
21     {input0},
22     {output0});
23   assert(model->isValid());
24 }
25 
is_ignored(int i)26 inline bool is_ignored(int i) {
27   static std::set<int> ignore = {};
28   return ignore.find(i) != ignore.end();
29 }
30 
CreateModel_dynamic_output_shape(Model * model)31 void CreateModel_dynamic_output_shape(Model *model) {
32   OperandType type0(Type::TENSOR_QUANT8_ASYMM, {1, 2, 3, 1}, 2.3f, 4);
33   OperandType type1(Type::TENSOR_INT32, {4, 2});
34   OperandType type2(Type::INT32, {});
35   OperandType type4(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 2.3f, 4);
36   // Phase 1, operands
37   auto input0 = model->addOperand(&type0);
38   auto paddings = model->addOperand(&type1);
39   auto pad_value = model->addOperand(&type2);
40   auto output0 = model->addOperand(&type4);
41   // Phase 2, operations
42   static int32_t paddings_init[] = {0, 0, 0, 2, 1, 3, 0, 0};
43   model->setOperandValue(paddings, paddings_init, sizeof(int32_t) * 8);
44   static int32_t pad_value_init[] = {9};
45   model->setOperandValue(pad_value, pad_value_init, sizeof(int32_t) * 1);
46   model->addOperation(ANEURALNETWORKS_PAD_V2, {input0, paddings, pad_value}, {output0});
47   // Phase 3, inputs and outputs
48   model->identifyInputsAndOutputs(
49     {input0},
50     {output0});
51   assert(model->isValid());
52 }
53 
is_ignored_dynamic_output_shape(int i)54 inline bool is_ignored_dynamic_output_shape(int i) {
55   static std::set<int> ignore = {};
56   return ignore.find(i) != ignore.end();
57 }
58 
59