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