1 // clang-format off 2 // Generated file (from: transpose_relaxed.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_INT32, 17 .dimensions = {4}, 18 .numberOfConsumers = 1, 19 .scale = 0.0f, 20 .zeroPoint = 0, 21 .lifetime = OperandLifeTime::CONSTANT_COPY, 22 .location = {.poolIndex = 0, .offset = 0, .length = 16}, 23 }, 24 { 25 .type = OperandType::TENSOR_FLOAT32, 26 .dimensions = {1, 2, 2, 1}, 27 .numberOfConsumers = 0, 28 .scale = 0.0f, 29 .zeroPoint = 0, 30 .lifetime = OperandLifeTime::MODEL_OUTPUT, 31 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 32 } 33 }; 34 35 const std::vector<Operation> operations = { 36 { 37 .type = OperationType::TRANSPOSE, 38 .inputs = {0, 1}, 39 .outputs = {2}, 40 } 41 }; 42 43 const std::vector<uint32_t> inputIndexes = {0}; 44 const std::vector<uint32_t> outputIndexes = {2}; 45 std::vector<uint8_t> operandValues = { 46 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0 47 }; 48 const std::vector<hidl_memory> pools = {}; 49 50 return { 51 .operands = operands, 52 .operations = operations, 53 .inputIndexes = inputIndexes, 54 .outputIndexes = outputIndexes, 55 .operandValues = operandValues, 56 .pools = pools, 57 .relaxComputationFloat32toFloat16 = true, 58 }; 59 } 60 61 inline bool is_ignored(int i) { 62 static std::set<int> ignore = {}; 63 return ignore.find(i) != ignore.end(); 64 } 65 66 // Create the model 67 Model createTestModel_dynamic_output_shape() { 68 const std::vector<Operand> operands = { 69 { 70 .type = OperandType::TENSOR_FLOAT32, 71 .dimensions = {1, 2, 2, 1}, 72 .numberOfConsumers = 1, 73 .scale = 0.0f, 74 .zeroPoint = 0, 75 .lifetime = OperandLifeTime::MODEL_INPUT, 76 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 77 }, 78 { 79 .type = OperandType::TENSOR_INT32, 80 .dimensions = {4}, 81 .numberOfConsumers = 1, 82 .scale = 0.0f, 83 .zeroPoint = 0, 84 .lifetime = OperandLifeTime::CONSTANT_COPY, 85 .location = {.poolIndex = 0, .offset = 0, .length = 16}, 86 }, 87 { 88 .type = OperandType::TENSOR_FLOAT32, 89 .dimensions = {0, 0, 0, 0}, 90 .numberOfConsumers = 0, 91 .scale = 0.0f, 92 .zeroPoint = 0, 93 .lifetime = OperandLifeTime::MODEL_OUTPUT, 94 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 95 } 96 }; 97 98 const std::vector<Operation> operations = { 99 { 100 .type = OperationType::TRANSPOSE, 101 .inputs = {0, 1}, 102 .outputs = {2}, 103 } 104 }; 105 106 const std::vector<uint32_t> inputIndexes = {0}; 107 const std::vector<uint32_t> outputIndexes = {2}; 108 std::vector<uint8_t> operandValues = { 109 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0 110 }; 111 const std::vector<hidl_memory> pools = {}; 112 113 return { 114 .operands = operands, 115 .operations = operations, 116 .inputIndexes = inputIndexes, 117 .outputIndexes = outputIndexes, 118 .operandValues = operandValues, 119 .pools = pools, 120 .relaxComputationFloat32toFloat16 = true, 121 }; 122 } 123 124 inline bool is_ignored_dynamic_output_shape(int i) { 125 static std::set<int> ignore = {}; 126 return ignore.find(i) != ignore.end(); 127 } 128 129