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