1 // clang-format off 2 // Generated file (from: neg.mod.py). Do not edit 3 void CreateModel(Model *model) { 4 OperandType type0(Type::TENSOR_FLOAT32, {1, 2, 3, 4, 5}); 5 // Phase 1, operands 6 auto input0 = model->addOperand(&type0); 7 auto output0 = model->addOperand(&type0); 8 // Phase 2, operations 9 model->addOperation(ANEURALNETWORKS_NEG, {input0}, {output0}); 10 // Phase 3, inputs and outputs 11 model->identifyInputsAndOutputs( 12 {input0}, 13 {output0}); 14 assert(model->isValid()); 15 } 16 17 inline bool is_ignored(int i) { 18 static std::set<int> ignore = {}; 19 return ignore.find(i) != ignore.end(); 20 } 21 22 void CreateModel_relaxed(Model *model) { 23 OperandType type0(Type::TENSOR_FLOAT32, {1, 2, 3, 4, 5}); 24 // Phase 1, operands 25 auto input0 = model->addOperand(&type0); 26 auto output0 = model->addOperand(&type0); 27 // Phase 2, operations 28 model->addOperation(ANEURALNETWORKS_NEG, {input0}, {output0}); 29 // Phase 3, inputs and outputs 30 model->identifyInputsAndOutputs( 31 {input0}, 32 {output0}); 33 // Phase 4: set relaxed execution 34 model->relaxComputationFloat32toFloat16(true); 35 assert(model->isValid()); 36 } 37 38 inline bool is_ignored_relaxed(int i) { 39 static std::set<int> ignore = {}; 40 return ignore.find(i) != ignore.end(); 41 } 42 43 void CreateModel_float16(Model *model) { 44 OperandType type1(Type::TENSOR_FLOAT16, {1, 2, 3, 4, 5}); 45 // Phase 1, operands 46 auto input0 = model->addOperand(&type1); 47 auto output0 = model->addOperand(&type1); 48 // Phase 2, operations 49 model->addOperation(ANEURALNETWORKS_NEG, {input0}, {output0}); 50 // Phase 3, inputs and outputs 51 model->identifyInputsAndOutputs( 52 {input0}, 53 {output0}); 54 assert(model->isValid()); 55 } 56 57 inline bool is_ignored_float16(int i) { 58 static std::set<int> ignore = {}; 59 return ignore.find(i) != ignore.end(); 60 } 61 62 void CreateModel_int32(Model *model) { 63 OperandType type2(Type::TENSOR_INT32, {1, 2, 3, 4, 5}); 64 // Phase 1, operands 65 auto input0 = model->addOperand(&type2); 66 auto output0 = model->addOperand(&type2); 67 // Phase 2, operations 68 model->addOperation(ANEURALNETWORKS_NEG, {input0}, {output0}); 69 // Phase 3, inputs and outputs 70 model->identifyInputsAndOutputs( 71 {input0}, 72 {output0}); 73 assert(model->isValid()); 74 } 75 76 inline bool is_ignored_int32(int i) { 77 static std::set<int> ignore = {}; 78 return ignore.find(i) != ignore.end(); 79 } 80 81 void CreateModel_dynamic_output_shape(Model *model) { 82 OperandType type0(Type::TENSOR_FLOAT32, {1, 2, 3, 4, 5}); 83 OperandType type3(Type::TENSOR_FLOAT32, {0, 0, 0, 0, 0}); 84 // Phase 1, operands 85 auto input0 = model->addOperand(&type0); 86 auto output0 = model->addOperand(&type3); 87 // Phase 2, operations 88 model->addOperation(ANEURALNETWORKS_NEG, {input0}, {output0}); 89 // Phase 3, inputs and outputs 90 model->identifyInputsAndOutputs( 91 {input0}, 92 {output0}); 93 assert(model->isValid()); 94 } 95 96 inline bool is_ignored_dynamic_output_shape(int i) { 97 static std::set<int> ignore = {}; 98 return ignore.find(i) != ignore.end(); 99 } 100 101 void CreateModel_dynamic_output_shape_relaxed(Model *model) { 102 OperandType type0(Type::TENSOR_FLOAT32, {1, 2, 3, 4, 5}); 103 OperandType type3(Type::TENSOR_FLOAT32, {0, 0, 0, 0, 0}); 104 // Phase 1, operands 105 auto input0 = model->addOperand(&type0); 106 auto output0 = model->addOperand(&type3); 107 // Phase 2, operations 108 model->addOperation(ANEURALNETWORKS_NEG, {input0}, {output0}); 109 // Phase 3, inputs and outputs 110 model->identifyInputsAndOutputs( 111 {input0}, 112 {output0}); 113 // Phase 4: set relaxed execution 114 model->relaxComputationFloat32toFloat16(true); 115 assert(model->isValid()); 116 } 117 118 inline bool is_ignored_dynamic_output_shape_relaxed(int i) { 119 static std::set<int> ignore = {}; 120 return ignore.find(i) != ignore.end(); 121 } 122 123 void CreateModel_dynamic_output_shape_float16(Model *model) { 124 OperandType type1(Type::TENSOR_FLOAT16, {1, 2, 3, 4, 5}); 125 OperandType type4(Type::TENSOR_FLOAT16, {0, 0, 0, 0, 0}); 126 // Phase 1, operands 127 auto input0 = model->addOperand(&type1); 128 auto output0 = model->addOperand(&type4); 129 // Phase 2, operations 130 model->addOperation(ANEURALNETWORKS_NEG, {input0}, {output0}); 131 // Phase 3, inputs and outputs 132 model->identifyInputsAndOutputs( 133 {input0}, 134 {output0}); 135 assert(model->isValid()); 136 } 137 138 inline bool is_ignored_dynamic_output_shape_float16(int i) { 139 static std::set<int> ignore = {}; 140 return ignore.find(i) != ignore.end(); 141 } 142 143 void CreateModel_dynamic_output_shape_int32(Model *model) { 144 OperandType type2(Type::TENSOR_INT32, {1, 2, 3, 4, 5}); 145 OperandType type5(Type::TENSOR_INT32, {0, 0, 0, 0, 0}); 146 // Phase 1, operands 147 auto input0 = model->addOperand(&type2); 148 auto output0 = model->addOperand(&type5); 149 // Phase 2, operations 150 model->addOperation(ANEURALNETWORKS_NEG, {input0}, {output0}); 151 // Phase 3, inputs and outputs 152 model->identifyInputsAndOutputs( 153 {input0}, 154 {output0}); 155 assert(model->isValid()); 156 } 157 158 inline bool is_ignored_dynamic_output_shape_int32(int i) { 159 static std::set<int> ignore = {}; 160 return ignore.find(i) != ignore.end(); 161 } 162 163