| 336 | |
| 337 | template <typename integer_type, TensorType tensor_dtype> |
| 338 | void SimpleConstTest() { |
| 339 | // Padding is represented as four 2-D lists representing above padding and |
| 340 | // below padding (i.e. {{0, 0}, {1, 1}, {1, 1}, {0, 0}}). |
| 341 | PadOpConstModel m({tensor_dtype, {1, 2, 2, 1}, -1.0, 1.0}, {4, 2}, |
| 342 | {0, 0, 1, 1, 1, 1, 0, 0}, {tensor_dtype, {}, -1.0, 1.0}); |
| 343 | m.template SetQuantizedInput<integer_type>({-0.8, 0.2, 0.9, 0.7}); |
| 344 | m.Invoke(); |
| 345 | EXPECT_THAT(m.template GetDequantizedOutput<integer_type>(), |
| 346 | ElementsAreArray(DequantizedArrayNear( |
| 347 | {0, 0, 0, 0, 0, -0.8, 0.2, 0, 0, 0.9, 0.7, 0, 0, 0, 0, 0}, |
| 348 | -1.0, 1.0))); |
| 349 | EXPECT_THAT(m.GetOutputShape(), ElementsAreArray({1, 4, 4, 1})); |
| 350 | } |
| 351 | |
| 352 | TEST_F(QuantizedPadOpTest, UInt8SimpleConstTest) { |
| 353 | SimpleConstTest<uint8_t, TensorType_UINT8>(); |
nothing calls this directly
no test coverage detected