MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / SimpleConstTest

Function SimpleConstTest

tensorflow/lite/kernels/pad_test.cc:338–350  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

336
337template <typename integer_type, TensorType tensor_dtype>
338void 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
352TEST_F(QuantizedPadOpTest, UInt8SimpleConstTest) {
353 SimpleConstTest<uint8_t, TensorType_UINT8>();

Callers

nothing calls this directly

Calls 3

DequantizedArrayNearFunction · 0.70
InvokeMethod · 0.45
GetOutputShapeMethod · 0.45

Tested by

no test coverage detected