| 592 | |
| 593 | template <typename integer_type, TensorType tensor_dtype> |
| 594 | void SimpleConstTestV2() { |
| 595 | // Padding is represented as four 2-D lists representing above padding and |
| 596 | // below padding (i.e. {{0, 0}, {1, 1}, {1, 1}, {0, 0}}). |
| 597 | PadV2OpConstModel<integer_type> m( |
| 598 | {tensor_dtype, {1, 2, 2, 1}, -1.0, 1.0}, {4, 2}, {0, 0, 1, 1, 1, 1, 0, 0}, |
| 599 | {tensor_dtype, {1}, -1.0, 1.0}, {tensor_dtype, {}, -1.0, 1.0}); |
| 600 | m.template SetQuantizedInput<integer_type>({-0.8, 0.2, 0.9, 0.7}); |
| 601 | m.template SetQuantizedPadValue<integer_type>(0); |
| 602 | m.Invoke(); |
| 603 | EXPECT_THAT(m.template GetDequantizedOutput<integer_type>(), |
| 604 | ElementsAreArray(DequantizedArrayNear( |
| 605 | {0, 0, 0, 0, 0, -0.8, 0.2, 0, 0, 0.9, 0.7, 0, 0, 0, 0, 0}, |
| 606 | -1.0, 1.0))); |
| 607 | EXPECT_THAT(m.GetOutputShape(), ElementsAreArray({1, 4, 4, 1})); |
| 608 | } |
| 609 | |
| 610 | TEST_F(QuantizedPadV2OpTest, UInt8SimpleConstTest) { |
| 611 | SimpleConstTestV2<uint8_t, TensorType_UINT8>(); |
nothing calls this directly
no test coverage detected