1 // clang-format off 2 // Generated file (from: tanh.mod.py). Do not edit 3 // Create the model 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 }; 47 } 48 49 inline bool is_ignored(int i) { 50 static std::set<int> ignore = {}; 51 return ignore.find(i) != ignore.end(); 52 } 53 54 // Create the model 55 Model createTestModel_dynamic_output_shape() { 56 const std::vector<Operand> operands = { 57 { 58 .type = OperandType::TENSOR_FLOAT32, 59 .dimensions = {1, 2, 2, 1}, 60 .numberOfConsumers = 1, 61 .scale = 0.0f, 62 .zeroPoint = 0, 63 .lifetime = OperandLifeTime::MODEL_INPUT, 64 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 65 }, 66 { 67 .type = OperandType::TENSOR_FLOAT32, 68 .dimensions = {0, 0, 0, 0}, 69 .numberOfConsumers = 0, 70 .scale = 0.0f, 71 .zeroPoint = 0, 72 .lifetime = OperandLifeTime::MODEL_OUTPUT, 73 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 74 } 75 }; 76 77 const std::vector<Operation> operations = { 78 { 79 .type = OperationType::TANH, 80 .inputs = {0}, 81 .outputs = {1}, 82 } 83 }; 84 85 const std::vector<uint32_t> inputIndexes = {0}; 86 const std::vector<uint32_t> outputIndexes = {1}; 87 std::vector<uint8_t> operandValues = {}; 88 const std::vector<hidl_memory> pools = {}; 89 90 return { 91 .operands = operands, 92 .operations = operations, 93 .inputIndexes = inputIndexes, 94 .outputIndexes = outputIndexes, 95 .operandValues = operandValues, 96 .pools = pools, 97 }; 98 } 99 100 inline bool is_ignored_dynamic_output_shape(int i) { 101 static std::set<int> ignore = {}; 102 return ignore.find(i) != ignore.end(); 103 } 104 105