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

Function AdvancedDynamicTestV2

tensorflow/lite/kernels/pad_test.cc:664–678  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

662
663template <typename integer_type, TensorType tensor_dtype>
664void AdvancedDynamicTestV2() {
665 PadV2OpDynamicModel<integer_type> m({tensor_dtype, {1, 2, 3, 1}, -1.0, 1.0},
666 {4, 2}, {tensor_dtype, {1}, -1.0, 1.0},
667 {tensor_dtype, {}, -1.0, 1.0});
668 m.template SetQuantizedInput<integer_type>({-0.8, 0.2, 0.9, 0.7, 0.1, -0.3});
669 m.template SetQuantizedPadValue<integer_type>(0);
670 m.SetPaddings({0, 0, 0, 2, 1, 3, 0, 0});
671 m.Invoke();
672 EXPECT_THAT(m.template GetDequantizedOutput<integer_type>(),
673 ElementsAreArray(DequantizedArrayNear(
674 {0, -0.8, 0.2, 0.9, 0, 0, 0, 0, 0.7, 0.1, -0.3, 0, 0, 0,
675 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
676 -1.0, 1.0)));
677 EXPECT_THAT(m.GetOutputShape(), ElementsAreArray({1, 4, 7, 1}));
678}
679
680TEST_F(QuantizedPadV2OpTest, UInt8AdvancedDynamicTest) {
681 AdvancedDynamicTestV2<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