| 125 | } |
| 126 | |
| 127 | void SplitVFp32Test() |
| 128 | { |
| 129 | std::vector<int32_t> axisShape { 1 }; |
| 130 | std::vector<int32_t> inputShape { 2, 4, 2, 2 }; |
| 131 | std::vector<int32_t> splitsShape { 2 }; |
| 132 | std::vector<int32_t> outputShape0 { 2, 3, 2, 2 }; |
| 133 | std::vector<int32_t> outputShape1 { 2, 1, 2, 2 }; |
| 134 | std::vector<std::vector<int32_t>> outputShapes{ outputShape0, outputShape1 }; |
| 135 | |
| 136 | std::vector<int32_t> axisData { 1 }; // Axis |
| 137 | std::vector<int32_t> splitsData { 3, 1 }; // Splits |
| 138 | std::vector<float> inputValues { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, |
| 139 | 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, |
| 140 | 17.0f, 18.0f, 19.0f, 20.0f, 21.0f, 22.0f, 23.0f, 24.0f, |
| 141 | 25.0f, 26.0f, 27.0f, 28.0f, 29.0f, 30.0f, 31.0f, 32.0f }; // Input |
| 142 | |
| 143 | |
| 144 | std::vector<float> expectedOutputValues0 { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, |
| 145 | 9.0f, 10.0f, 11.0f, 12.0f, 17.0f, 18.0f, 19.0f, 20.0f, |
| 146 | 21.0f, 22.0f, 23.0f, 24.0f, 25.0f, 26.0f, 27.0f, 28.0f }; |
| 147 | std::vector<float> expectedOutputValues1 { 13.0f, 14.0f, 15.0f, 16.0f, 29.0f, 30.0f, 31.0f, 32.0f }; |
| 148 | std::vector<std::vector<float>> expectedOutputValues{ expectedOutputValues0, expectedOutputValues1 }; |
| 149 | |
| 150 | int32_t numSplits = 2; |
| 151 | |
| 152 | SplitVTest<float>(::tflite::TensorType_FLOAT32, |
| 153 | inputShape, |
| 154 | splitsShape, |
| 155 | axisShape, |
| 156 | outputShapes, |
| 157 | inputValues, |
| 158 | splitsData, |
| 159 | axisData, |
| 160 | expectedOutputValues, |
| 161 | numSplits); |
| 162 | } |
| 163 | |
| 164 | void SplitVFp32ZeroDimTest() |
| 165 | { |