| 711 | |
| 712 | template <typename integer_type, TensorType tensor_dtype> |
| 713 | void SimpleDynamicValuedTest() { |
| 714 | PadV2OpDynamicModel<integer_type> m({tensor_dtype, {1, 2, 2, 1}, -1.0, 1.0}, |
| 715 | {4, 2}, {tensor_dtype, {1}, -1.0, 1.0}, |
| 716 | {tensor_dtype, {}, -1.0, 1.0}); |
| 717 | m.template SetQuantizedInput<integer_type>({-0.8, 0.2, 0.9, 0.7}); |
| 718 | m.template SetQuantizedPadValue<integer_type>(-0.5); |
| 719 | m.SetPaddings({0, 0, 1, 1, 1, 1, 0, 0}); |
| 720 | m.Invoke(); |
| 721 | EXPECT_THAT(m.template GetDequantizedOutput<integer_type>(), |
| 722 | ElementsAreArray(DequantizedArrayNear( |
| 723 | {-0.5, -0.5, -0.5, -0.5, -0.5, -0.8, 0.2, -0.5, -0.5, 0.9, |
| 724 | 0.7, -0.5, -0.5, -0.5, -0.5, -0.5}, |
| 725 | -1.0, 1.0))); |
| 726 | EXPECT_THAT(m.GetOutputShape(), ElementsAreArray({1, 4, 4, 1})); |
| 727 | } |
| 728 | |
| 729 | TEST_F(QuantizedPadV2OpTest, UInt8SimpleDynamicValuedTest) { |
| 730 | SimpleDynamicValuedTest<uint8_t, TensorType_UINT8>(); |
nothing calls this directly
no test coverage detected