• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // clang-format off
2 // Generated file (from: softmax_float_2.mod.py). Do not edit
CreateModel(Model * model)3 void CreateModel(Model *model) {
4   OperandType type0(Type::TENSOR_FLOAT32, {2, 5});
5   OperandType type1(Type::FLOAT32, {});
6   // Phase 1, operands
7   auto input = model->addOperand(&type0);
8   auto beta = model->addOperand(&type1);
9   auto output = model->addOperand(&type0);
10   // Phase 2, operations
11   static float beta_init[] = {1.0f};
12   model->setOperandValue(beta, beta_init, sizeof(float) * 1);
13   model->addOperation(ANEURALNETWORKS_SOFTMAX, {input, beta}, {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, {2, 5});
28   OperandType type1(Type::FLOAT32, {});
29   OperandType type2(Type::TENSOR_FLOAT32, {0, 0});
30   // Phase 1, operands
31   auto input = model->addOperand(&type0);
32   auto beta = model->addOperand(&type1);
33   auto output = model->addOperand(&type2);
34   // Phase 2, operations
35   static float beta_init[] = {1.0f};
36   model->setOperandValue(beta, beta_init, sizeof(float) * 1);
37   model->addOperation(ANEURALNETWORKS_SOFTMAX, {input, beta}, {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