• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // clang-format off
2 // Generated file (from: mul_relu.mod.py). Do not edit
CreateModel(Model * model)3 void CreateModel(Model *model) {
4   OperandType type0(Type::TENSOR_FLOAT32, {1, 2, 2, 1});
5   OperandType type1(Type::INT32, {});
6   // Phase 1, operands
7   auto op1 = model->addOperand(&type0);
8   auto op2 = model->addOperand(&type0);
9   auto act = model->addOperand(&type1);
10   auto op3 = model->addOperand(&type0);
11   // Phase 2, operations
12   static int32_t act_init[] = {1};
13   model->setOperandValue(act, act_init, sizeof(int32_t) * 1);
14   model->addOperation(ANEURALNETWORKS_MUL, {op1, op2, act}, {op3});
15   // Phase 3, inputs and outputs
16   model->identifyInputsAndOutputs(
17     {op1, op2},
18     {op3});
19   assert(model->isValid());
20 }
21 
is_ignored(int i)22 inline bool is_ignored(int i) {
23   static std::set<int> ignore = {};
24   return ignore.find(i) != ignore.end();
25 }
26 
CreateModel_dynamic_output_shape(Model * model)27 void CreateModel_dynamic_output_shape(Model *model) {
28   OperandType type0(Type::TENSOR_FLOAT32, {1, 2, 2, 1});
29   OperandType type1(Type::INT32, {});
30   OperandType type2(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
31   // Phase 1, operands
32   auto op1 = model->addOperand(&type0);
33   auto op2 = model->addOperand(&type0);
34   auto act = model->addOperand(&type1);
35   auto op3 = model->addOperand(&type2);
36   // Phase 2, operations
37   static int32_t act_init[] = {1};
38   model->setOperandValue(act, act_init, sizeof(int32_t) * 1);
39   model->addOperation(ANEURALNETWORKS_MUL, {op1, op2, act}, {op3});
40   // Phase 3, inputs and outputs
41   model->identifyInputsAndOutputs(
42     {op1, op2},
43     {op3});
44   assert(model->isValid());
45 }
46 
is_ignored_dynamic_output_shape(int i)47 inline bool is_ignored_dynamic_output_shape(int i) {
48   static std::set<int> ignore = {};
49   return ignore.find(i) != ignore.end();
50 }
51 
52