| 31 | namespace { |
| 32 | |
| 33 | TEST(ConcatTest, TwoInputTensorsByUnalignedChannel) { |
| 34 | TensorRef<BHWC> input1, input2, output; |
| 35 | input1.type = DataType::FLOAT32; |
| 36 | input1.ref = 0; |
| 37 | input1.shape = BHWC(1, 2, 2, 1); |
| 38 | |
| 39 | input2.type = DataType::FLOAT32; |
| 40 | input2.ref = 1; |
| 41 | input2.shape = BHWC(1, 2, 2, 1); |
| 42 | |
| 43 | output.type = DataType::FLOAT32; |
| 44 | output.ref = 2; |
| 45 | output.shape = BHWC(1, 2, 2, 2); |
| 46 | |
| 47 | ConcatAttributes attr; |
| 48 | attr.axis = Axis::CHANNELS; |
| 49 | |
| 50 | SingleOpModel model({ToString(OperationType::CONCAT), attr}, {input1, input2}, |
| 51 | {output}); |
| 52 | ASSERT_TRUE(model.PopulateTensor(0, {1, 3, 5, 7})); |
| 53 | ASSERT_TRUE(model.PopulateTensor(1, {2, 4, 6, 8})); |
| 54 | ASSERT_OK(model.Invoke(*NewConcatNodeShader())); |
| 55 | EXPECT_THAT(model.GetOutput(0), |
| 56 | Pointwise(FloatNear(1e-6), {1, 2, 3, 4, 5, 6, 7, 8})); |
| 57 | } |
| 58 | |
| 59 | TEST(ConcatTest, TwoInputTensorsByAlignedChannel) { |
| 60 | TensorRef<BHWC> input1, input2, output; |
nothing calls this directly
no test coverage detected