• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Generated file (from: hashtable_lookup_float_relaxed.mod.py). Do not edit
CreateModel(Model * model)2 void CreateModel(Model *model) {
3   OperandType type2(Type::TENSOR_FLOAT32, {3, 2});
4   OperandType type3(Type::TENSOR_FLOAT32, {4, 2});
5   OperandType type1(Type::TENSOR_INT32, {3});
6   OperandType type0(Type::TENSOR_INT32, {4});
7   OperandType type4(Type::TENSOR_QUANT8_ASYMM, {4}, 1.f, 0);
8   // Phase 1, operands
9   auto lookup = model->addOperand(&type0);
10   auto key = model->addOperand(&type1);
11   auto value = model->addOperand(&type2);
12   auto output = model->addOperand(&type3);
13   auto hits = model->addOperand(&type4);
14   // Phase 2, operations
15   model->addOperation(ANEURALNETWORKS_HASHTABLE_LOOKUP, {lookup, key, value}, {output, hits});
16   // Phase 3, inputs and outputs
17   model->identifyInputsAndOutputs(
18     {lookup, key, value},
19     {output, hits});
20   // Phase 4: set relaxed execution
21   model->relaxComputationFloat32toFloat16(true);
22   assert(model->isValid());
23 }
24 
is_ignored(int i)25 bool is_ignored(int i) {
26   static std::set<int> ignore = {};
27   return ignore.find(i) != ignore.end();
28 }
29