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

Function SimpleDynamicTest

tensorflow/lite/kernels/pad_test.cc:360–371  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

358
359template <typename integer_type, TensorType tensor_dtype>
360void SimpleDynamicTest() {
361 PadOpDynamicModel m({tensor_dtype, {1, 2, 2, 1}, -1.0, 1.0}, {4, 2},
362 {tensor_dtype, {}, -1.0, 1.0});
363 m.template SetQuantizedInput<integer_type>({-0.8, 0.2, 0.9, 0.7});
364 m.SetPaddings({0, 0, 1, 1, 1, 1, 0, 0});
365 m.Invoke();
366 EXPECT_THAT(m.template GetDequantizedOutput<integer_type>(),
367 ElementsAreArray(DequantizedArrayNear(
368 {0, 0, 0, 0, 0, -0.8, 0.2, 0, 0, 0.9, 0.7, 0, 0, 0, 0, 0},
369 -1.0, 1.0)));
370 EXPECT_THAT(m.GetOutputShape(), ElementsAreArray({1, 4, 4, 1}));
371}
372
373TEST_F(QuantizedPadOpTest, UInt8SimpleDynamicTest) {
374 SimpleDynamicTest<uint8_t, TensorType_UINT8>();

Callers

nothing calls this directly

Calls 4

DequantizedArrayNearFunction · 0.70
SetPaddingsMethod · 0.45
InvokeMethod · 0.45
GetOutputShapeMethod · 0.45

Tested by

no test coverage detected