| 759 | |
| 760 | template <typename integer_type, TensorType tensor_dtype> |
| 761 | void AdvancedDynamicValuedTest() { |
| 762 | PadV2OpDynamicModel<integer_type> m({tensor_dtype, {1, 2, 3, 1}, -1.0, 1.0}, |
| 763 | {4, 2}, {tensor_dtype, {1}, -1.0, 1.0}, |
| 764 | {tensor_dtype, {}, -1.0, 1.0}); |
| 765 | m.template SetQuantizedInput<integer_type>({-0.8, 0.2, 0.9, 0.7, 0.1, -0.3}); |
| 766 | m.template SetQuantizedPadValue<integer_type>(-0.5); |
| 767 | m.SetPaddings({0, 0, 0, 2, 1, 3, 0, 0}); |
| 768 | m.Invoke(); |
| 769 | EXPECT_THAT(m.template GetDequantizedOutput<integer_type>(), |
| 770 | ElementsAreArray(DequantizedArrayNear( |
| 771 | {-0.5, -0.8, 0.2, 0.9, -0.5, -0.5, -0.5, -0.5, 0.7, 0.1, |
| 772 | -0.3, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, |
| 773 | -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5}, |
| 774 | -1.0, 1.0))); |
| 775 | EXPECT_THAT(m.GetOutputShape(), ElementsAreArray({1, 4, 7, 1})); |
| 776 | } |
| 777 | |
| 778 | TEST_F(QuantizedPadV2OpTest, UInt8AdvancedDynamicValuedTest) { |
| 779 | AdvancedDynamicValuedTest<uint8_t, TensorType_UINT8>(); |
nothing calls this directly
no test coverage detected