• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Generated file (from: svdf2.mod.py). Do not edit
CreateModel(Model * model)2 void CreateModel(Model *model) {
3   OperandType type5(Type::INT32, {});
4   OperandType type0(Type::TENSOR_FLOAT32, {2, 3});
5   OperandType type6(Type::TENSOR_FLOAT32, {2, 4});
6   OperandType type4(Type::TENSOR_FLOAT32, {2, 80});
7   OperandType type3(Type::TENSOR_FLOAT32, {4});
8   OperandType type2(Type::TENSOR_FLOAT32, {8, 10});
9   OperandType type1(Type::TENSOR_FLOAT32, {8, 3});
10   // Phase 1, operands
11   auto input = model->addOperand(&type0);
12   auto weights_feature = model->addOperand(&type1);
13   auto weights_time = model->addOperand(&type2);
14   auto bias = model->addOperand(&type3);
15   auto state_in = model->addOperand(&type4);
16   auto rank_param = model->addOperand(&type5);
17   auto activation_param = model->addOperand(&type5);
18   auto state_out = model->addOperand(&type4);
19   auto output = model->addOperand(&type6);
20   // Phase 2, operations
21   static int32_t rank_param_init[] = {2};
22   model->setOperandValue(rank_param, rank_param_init, sizeof(int32_t) * 1);
23   static int32_t activation_param_init[] = {0};
24   model->setOperandValue(activation_param, activation_param_init, sizeof(int32_t) * 1);
25   model->addOperation(ANEURALNETWORKS_SVDF, {input, weights_feature, weights_time, bias, state_in, rank_param, activation_param}, {state_out, output});
26   // Phase 3, inputs and outputs
27   model->identifyInputsAndOutputs(
28     {input, weights_feature, weights_time, bias, state_in},
29     {state_out, output});
30   assert(model->isValid());
31 }
32 
is_ignored(int i)33 bool is_ignored(int i) {
34   static std::set<int> ignore = {0};
35   return ignore.find(i) != ignore.end();
36 }
37