• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Generated file (from: resize_bilinear_relaxed.mod.py). Do not edit
CreateModel(Model * model)2 void CreateModel(Model *model) {
3   OperandType type2(Type::INT32, {});
4   OperandType type0(Type::TENSOR_FLOAT32, {1, 2, 2, 1});
5   OperandType type1(Type::TENSOR_FLOAT32, {1, 3, 3, 1});
6   // Phase 1, operands
7   auto op1 = model->addOperand(&type0);
8   auto op2 = model->addOperand(&type1);
9   auto height = model->addOperand(&type2);
10   auto width = model->addOperand(&type2);
11   // Phase 2, operations
12   static int32_t height_init[] = {3};
13   model->setOperandValue(height, height_init, sizeof(int32_t) * 1);
14   static int32_t width_init[] = {3};
15   model->setOperandValue(width, width_init, sizeof(int32_t) * 1);
16   model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op1, height, width}, {op2});
17   // Phase 3, inputs and outputs
18   model->identifyInputsAndOutputs(
19     {op1},
20     {op2});
21   // Phase 4: set relaxed execution
22   model->relaxComputationFloat32toFloat16(true);
23   assert(model->isValid());
24 }
25 
is_ignored(int i)26 bool is_ignored(int i) {
27   static std::set<int> ignore = {};
28   return ignore.find(i) != ignore.end();
29 }
30