1 // clang-format off
2 // Generated file (from: tanh_relaxed.mod.py). Do not edit
3 // Create the model
createTestModel()4 Model createTestModel() {
5     const std::vector<Operand> operands = {
6         {
7             .type = OperandType::TENSOR_FLOAT32,
8             .dimensions = {1, 2, 2, 1},
9             .numberOfConsumers = 1,
10             .scale = 0.0f,
11             .zeroPoint = 0,
12             .lifetime = OperandLifeTime::MODEL_INPUT,
13             .location = {.poolIndex = 0, .offset = 0, .length = 0},
14         },
15         {
16             .type = OperandType::TENSOR_FLOAT32,
17             .dimensions = {1, 2, 2, 1},
18             .numberOfConsumers = 0,
19             .scale = 0.0f,
20             .zeroPoint = 0,
21             .lifetime = OperandLifeTime::MODEL_OUTPUT,
22             .location = {.poolIndex = 0, .offset = 0, .length = 0},
23         }
24     };
25 
26     const std::vector<Operation> operations = {
27         {
28             .type = OperationType::TANH,
29             .inputs = {0},
30             .outputs = {1},
31         }
32     };
33 
34     const std::vector<uint32_t> inputIndexes = {0};
35     const std::vector<uint32_t> outputIndexes = {1};
36     std::vector<uint8_t> operandValues = {};
37     const std::vector<hidl_memory> pools = {};
38 
39     return {
40         .operands = operands,
41         .operations = operations,
42         .inputIndexes = inputIndexes,
43         .outputIndexes = outputIndexes,
44         .operandValues = operandValues,
45         .pools = pools,
46         .relaxComputationFloat32toFloat16 = true,
47     };
48 }
49 
is_ignored(int i)50 inline bool is_ignored(int i) {
51   static std::set<int> ignore = {};
52   return ignore.find(i) != ignore.end();
53 }
54 
55 // Create the model
createTestModel_dynamic_output_shape()56 Model createTestModel_dynamic_output_shape() {
57     const std::vector<Operand> operands = {
58         {
59             .type = OperandType::TENSOR_FLOAT32,
60             .dimensions = {1, 2, 2, 1},
61             .numberOfConsumers = 1,
62             .scale = 0.0f,
63             .zeroPoint = 0,
64             .lifetime = OperandLifeTime::MODEL_INPUT,
65             .location = {.poolIndex = 0, .offset = 0, .length = 0},
66         },
67         {
68             .type = OperandType::TENSOR_FLOAT32,
69             .dimensions = {0, 0, 0, 0},
70             .numberOfConsumers = 0,
71             .scale = 0.0f,
72             .zeroPoint = 0,
73             .lifetime = OperandLifeTime::MODEL_OUTPUT,
74             .location = {.poolIndex = 0, .offset = 0, .length = 0},
75         }
76     };
77 
78     const std::vector<Operation> operations = {
79         {
80             .type = OperationType::TANH,
81             .inputs = {0},
82             .outputs = {1},
83         }
84     };
85 
86     const std::vector<uint32_t> inputIndexes = {0};
87     const std::vector<uint32_t> outputIndexes = {1};
88     std::vector<uint8_t> operandValues = {};
89     const std::vector<hidl_memory> pools = {};
90 
91     return {
92         .operands = operands,
93         .operations = operations,
94         .inputIndexes = inputIndexes,
95         .outputIndexes = outputIndexes,
96         .operandValues = operandValues,
97         .pools = pools,
98         .relaxComputationFloat32toFloat16 = true,
99     };
100 }
101 
is_ignored_dynamic_output_shape(int i)102 inline bool is_ignored_dynamic_output_shape(int i) {
103   static std::set<int> ignore = {};
104   return ignore.find(i) != ignore.end();
105 }
106 
107