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

Function AdvancedDynamicValuedTest

tensorflow/lite/kernels/pad_test.cc:761–776  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

759
760template <typename integer_type, TensorType tensor_dtype>
761void AdvancedDynamicValuedTest() {
762 PadV2OpDynamicModel<integer_type> m({tensor_dtype, {1, 2, 3, 1}, -1.0, 1.0},
763 {4, 2}, {tensor_dtype, {1}, -1.0, 1.0},
764 {tensor_dtype, {}, -1.0, 1.0});
765 m.template SetQuantizedInput<integer_type>({-0.8, 0.2, 0.9, 0.7, 0.1, -0.3});
766 m.template SetQuantizedPadValue<integer_type>(-0.5);
767 m.SetPaddings({0, 0, 0, 2, 1, 3, 0, 0});
768 m.Invoke();
769 EXPECT_THAT(m.template GetDequantizedOutput<integer_type>(),
770 ElementsAreArray(DequantizedArrayNear(
771 {-0.5, -0.8, 0.2, 0.9, -0.5, -0.5, -0.5, -0.5, 0.7, 0.1,
772 -0.3, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5,
773 -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5},
774 -1.0, 1.0)));
775 EXPECT_THAT(m.GetOutputShape(), ElementsAreArray({1, 4, 7, 1}));
776}
777
778TEST_F(QuantizedPadV2OpTest, UInt8AdvancedDynamicValuedTest) {
779 AdvancedDynamicValuedTest<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