| 121 | } |
| 122 | |
| 123 | void ReshapeFlattenAllTest(bool useOption = true, const std::vector<armnn::BackendId>& backends = {}) |
| 124 | { |
| 125 | // Set input data |
| 126 | std::vector<int32_t> inputShape { 1, 3, 4, 1 }; |
| 127 | std::vector<int32_t> outputShape { 12 }; |
| 128 | std::vector<int32_t> targetShape { -1 }; |
| 129 | |
| 130 | std::vector<float> inputValues = { -5.0f, 8.0f, -10.0f, 7.0f, |
| 131 | 8.0f, 12.0f, -15.0f, 2.0f, |
| 132 | 3.0f, -4.0f, -1.0f, -11.0f }; |
| 133 | |
| 134 | std::vector<float> expectedOutputValues = { -5.0f, 8.0f, -10.0f, 7.0f, |
| 135 | 8.0f, 12.0f, -15.0f, 2.0f, |
| 136 | 3.0f, -4.0f, -1.0f, -11.0f }; |
| 137 | |
| 138 | RedefineTest<float>(tflite::BuiltinOperator_RESHAPE, |
| 139 | ::tflite::TensorType_FLOAT32, |
| 140 | inputShape, |
| 141 | outputShape, |
| 142 | inputValues, |
| 143 | expectedOutputValues, |
| 144 | targetShape, |
| 145 | useOption, |
| 146 | backends); |
| 147 | } |
| 148 | |
| 149 | void ReshapeInt8Test(bool useOption = true, const std::vector<armnn::BackendId>& backends = {}) |
| 150 | { |