| 639 | |
| 640 | template <typename integer_type, TensorType tensor_dtype> |
| 641 | void AdvancedConstTestV2() { |
| 642 | PadV2OpConstModel<integer_type> m( |
| 643 | {tensor_dtype, {1, 2, 3, 1}, -1.0, 1.0}, {4, 2}, {0, 0, 0, 2, 1, 3, 0, 0}, |
| 644 | {tensor_dtype, {1}, -1.0, 1.0}, {tensor_dtype, {}, -1.0, 1.0}); |
| 645 | m.template SetQuantizedInput<integer_type>({-0.8, 0.2, 0.9, 0.7, 0.1, -0.3}); |
| 646 | m.template SetQuantizedPadValue<integer_type>(0); |
| 647 | m.Invoke(); |
| 648 | EXPECT_THAT(m.template GetDequantizedOutput<integer_type>(), |
| 649 | ElementsAreArray(DequantizedArrayNear( |
| 650 | {0, -0.8, 0.2, 0.9, 0, 0, 0, 0, 0.7, 0.1, -0.3, 0, 0, 0, |
| 651 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, |
| 652 | -1.0, 1.0))); |
| 653 | EXPECT_THAT(m.GetOutputShape(), ElementsAreArray({1, 4, 7, 1})); |
| 654 | } |
| 655 | |
| 656 | TEST_F(QuantizedPadV2OpTest, UInt8AdvancedConstTest) { |
| 657 | AdvancedConstTestV2<uint8_t, TensorType_UINT8>(); |
nothing calls this directly
no test coverage detected