1 // clang-format off
2 // Generated file (from: softmax_float_2_relaxed.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   // Phase 4: set relaxed execution
19   model->relaxComputationFloat32toFloat16(true);
20   assert(model->isValid());
21 }
22 
is_ignored(int i)23 inline bool is_ignored(int i) {
24   static std::set<int> ignore = {};
25   return ignore.find(i) != ignore.end();
26 }
27 
CreateModel_dynamic_output_shape(Model * model)28 void CreateModel_dynamic_output_shape(Model *model) {
29   OperandType type0(Type::TENSOR_FLOAT32, {2, 5});
30   OperandType type1(Type::FLOAT32, {});
31   OperandType type2(Type::TENSOR_FLOAT32, {0, 0});
32   // Phase 1, operands
33   auto input = model->addOperand(&type0);
34   auto beta = model->addOperand(&type1);
35   auto output = model->addOperand(&type2);
36   // Phase 2, operations
37   static float beta_init[] = {1.0f};
38   model->setOperandValue(beta, beta_init, sizeof(float) * 1);
39   model->addOperation(ANEURALNETWORKS_SOFTMAX, {input, beta}, {output});
40   // Phase 3, inputs and outputs
41   model->identifyInputsAndOutputs(
42     {input},
43     {output});
44   // Phase 4: set relaxed execution
45   model->relaxComputationFloat32toFloat16(true);
46   assert(model->isValid());
47 }
48 
is_ignored_dynamic_output_shape(int i)49 inline bool is_ignored_dynamic_output_shape(int i) {
50   static std::set<int> ignore = {};
51   return ignore.find(i) != ignore.end();
52 }
53 
54