1 // clang-format off
2 // Generated file (from: depth_to_space_float_3_relaxed.mod.py). Do not edit
CreateModel(Model * model)3 void CreateModel(Model *model) {
4   OperandType type0(Type::TENSOR_FLOAT32, {1, 2, 2, 8});
5   OperandType type1(Type::INT32, {});
6   OperandType type2(Type::TENSOR_FLOAT32, {1, 4, 4, 2});
7   // Phase 1, operands
8   auto input = model->addOperand(&type0);
9   auto block_size = model->addOperand(&type1);
10   auto output = model->addOperand(&type2);
11   // Phase 2, operations
12   static int32_t block_size_init[] = {2};
13   model->setOperandValue(block_size, block_size_init, sizeof(int32_t) * 1);
14   model->addOperation(ANEURALNETWORKS_DEPTH_TO_SPACE, {input, block_size}, {output});
15   // Phase 3, inputs and outputs
16   model->identifyInputsAndOutputs(
17     {input},
18     {output});
19   // Phase 4: set relaxed execution
20   model->relaxComputationFloat32toFloat16(true);
21   assert(model->isValid());
22 }
23 
is_ignored(int i)24 inline bool is_ignored(int i) {
25   static std::set<int> ignore = {};
26   return ignore.find(i) != ignore.end();
27 }
28 
CreateModel_dynamic_output_shape(Model * model)29 void CreateModel_dynamic_output_shape(Model *model) {
30   OperandType type0(Type::TENSOR_FLOAT32, {1, 2, 2, 8});
31   OperandType type1(Type::INT32, {});
32   OperandType type3(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
33   // Phase 1, operands
34   auto input = model->addOperand(&type0);
35   auto block_size = model->addOperand(&type1);
36   auto output = model->addOperand(&type3);
37   // Phase 2, operations
38   static int32_t block_size_init[] = {2};
39   model->setOperandValue(block_size, block_size_init, sizeof(int32_t) * 1);
40   model->addOperation(ANEURALNETWORKS_DEPTH_TO_SPACE, {input, block_size}, {output});
41   // Phase 3, inputs and outputs
42   model->identifyInputsAndOutputs(
43     {input},
44     {output});
45   // Phase 4: set relaxed execution
46   model->relaxComputationFloat32toFloat16(true);
47   assert(model->isValid());
48 }
49 
is_ignored_dynamic_output_shape(int i)50 inline bool is_ignored_dynamic_output_shape(int i) {
51   static std::set<int> ignore = {};
52   return ignore.find(i) != ignore.end();
53 }
54 
55