SPLIT Operator
| 12 | |
| 13 | // SPLIT Operator |
| 14 | void SplitUint8Test() |
| 15 | { |
| 16 | std::vector<int32_t> axisShape { 1 }; |
| 17 | std::vector<int32_t> inputShape { 2, 2, 2, 2} ; |
| 18 | std::vector<int32_t> outputShape0 { 2, 2, 2, 1 }; |
| 19 | std::vector<int32_t> outputShape1 { 2, 2, 2, 1 }; |
| 20 | std::vector<std::vector<int32_t>> outputShapes{ outputShape0, outputShape1 }; |
| 21 | |
| 22 | std::vector<int32_t> axisData { 3 }; // Axis |
| 23 | std::vector<uint8_t> inputValues { 1, 2, 3, 4, 5, 6, 7, 8, |
| 24 | 9, 10, 11, 12, 13, 14, 15, 16 }; // Input |
| 25 | |
| 26 | |
| 27 | std::vector<uint8_t> expectedOutputValues0 { 1, 3, 5, 7, 9, 11, 13, 15 }; |
| 28 | std::vector<uint8_t> expectedOutputValues1 { 2, 4, 6, 8, 10, 12, 14, 16 }; |
| 29 | std::vector<std::vector<uint8_t>> expectedOutputValues{ expectedOutputValues0, expectedOutputValues1 }; |
| 30 | |
| 31 | int32_t numSplits = 2; |
| 32 | |
| 33 | SplitTest<uint8_t>(::tflite::TensorType_UINT8, |
| 34 | axisShape, |
| 35 | inputShape, |
| 36 | outputShapes, |
| 37 | axisData, |
| 38 | inputValues, |
| 39 | expectedOutputValues, |
| 40 | numSplits); |
| 41 | } |
| 42 | |
| 43 | void SplitFp32Test() |
| 44 | { |