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

Function AdvancedDynamicTest

tensorflow/lite/kernels/pad_test.cc:402–414  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

400
401template <typename integer_type, TensorType tensor_dtype>
402void AdvancedDynamicTest() {
403 PadOpDynamicModel m({tensor_dtype, {1, 2, 3, 1}, -1.0, 1.0}, {4, 2},
404 {tensor_dtype, {}, -1.0, 1.0});
405 m.template SetQuantizedInput<integer_type>({-0.8, 0.2, 0.9, 0.7, 0.1, -0.3});
406 m.SetPaddings({0, 0, 0, 2, 1, 3, 0, 0});
407 m.Invoke();
408 EXPECT_THAT(m.template GetDequantizedOutput<integer_type>(),
409 ElementsAreArray(DequantizedArrayNear(
410 {0, -0.8, 0.2, 0.9, 0, 0, 0, 0, 0.7, 0.1, -0.3, 0, 0, 0,
411 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
412 -1.0, 1.0)));
413 EXPECT_THAT(m.GetOutputShape(), ElementsAreArray({1, 4, 7, 1}));
414}
415
416TEST_F(QuantizedPadOpTest, UInt8AdvancedDynamicTest) {
417 AdvancedDynamicTest<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