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

Function SimpleDynamicValuedTest

tensorflow/lite/kernels/pad_test.cc:713–727  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

711
712template <typename integer_type, TensorType tensor_dtype>
713void SimpleDynamicValuedTest() {
714 PadV2OpDynamicModel<integer_type> m({tensor_dtype, {1, 2, 2, 1}, -1.0, 1.0},
715 {4, 2}, {tensor_dtype, {1}, -1.0, 1.0},
716 {tensor_dtype, {}, -1.0, 1.0});
717 m.template SetQuantizedInput<integer_type>({-0.8, 0.2, 0.9, 0.7});
718 m.template SetQuantizedPadValue<integer_type>(-0.5);
719 m.SetPaddings({0, 0, 1, 1, 1, 1, 0, 0});
720 m.Invoke();
721 EXPECT_THAT(m.template GetDequantizedOutput<integer_type>(),
722 ElementsAreArray(DequantizedArrayNear(
723 {-0.5, -0.5, -0.5, -0.5, -0.5, -0.8, 0.2, -0.5, -0.5, 0.9,
724 0.7, -0.5, -0.5, -0.5, -0.5, -0.5},
725 -1.0, 1.0)));
726 EXPECT_THAT(m.GetOutputShape(), ElementsAreArray({1, 4, 4, 1}));
727}
728
729TEST_F(QuantizedPadV2OpTest, UInt8SimpleDynamicValuedTest) {
730 SimpleDynamicValuedTest<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