| 735 | |
| 736 | template <typename integer_type, TensorType tensor_dtype> |
| 737 | void AdvancedConstValuedTest() { |
| 738 | PadV2OpConstModel<integer_type> m( |
| 739 | {tensor_dtype, {1, 2, 3, 1}, -1.0, 1.0}, {4, 2}, {0, 0, 0, 2, 1, 3, 0, 0}, |
| 740 | {tensor_dtype, {1}, -1.0, 1.0}, {tensor_dtype, {}, -1.0, 1.0}); |
| 741 | m.template SetQuantizedInput<integer_type>({-0.8, 0.2, 0.9, 0.7, 0.1, -0.3}); |
| 742 | m.template SetQuantizedPadValue<integer_type>(-0.5); |
| 743 | m.Invoke(); |
| 744 | EXPECT_THAT(m.template GetDequantizedOutput<integer_type>(), |
| 745 | ElementsAreArray(DequantizedArrayNear( |
| 746 | {-0.5, -0.8, 0.2, 0.9, -0.5, -0.5, -0.5, -0.5, 0.7, 0.1, |
| 747 | -0.3, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, |
| 748 | -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5}, |
| 749 | -1.0, 1.0))); |
| 750 | EXPECT_THAT(m.GetOutputShape(), ElementsAreArray({1, 4, 7, 1})); |
| 751 | } |
| 752 | |
| 753 | TEST_F(QuantizedPadV2OpTest, UInt8AdvancedConstValuedTest) { |
| 754 | AdvancedConstValuedTest<uint8_t, TensorType_UINT8>(); |
nothing calls this directly
no test coverage detected