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

Function AdvancedConstValuedTest

tensorflow/lite/kernels/pad_test.cc:737–751  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

735
736template <typename integer_type, TensorType tensor_dtype>
737void AdvancedConstValuedTest() {
738 PadV2OpConstModel<integer_type> m(
739 {tensor_dtype, {1, 2, 3, 1}, -1.0, 1.0}, {4, 2}, {0, 0, 0, 2, 1, 3, 0, 0},
740 {tensor_dtype, {1}, -1.0, 1.0}, {tensor_dtype, {}, -1.0, 1.0});
741 m.template SetQuantizedInput<integer_type>({-0.8, 0.2, 0.9, 0.7, 0.1, -0.3});
742 m.template SetQuantizedPadValue<integer_type>(-0.5);
743 m.Invoke();
744 EXPECT_THAT(m.template GetDequantizedOutput<integer_type>(),
745 ElementsAreArray(DequantizedArrayNear(
746 {-0.5, -0.8, 0.2, 0.9, -0.5, -0.5, -0.5, -0.5, 0.7, 0.1,
747 -0.3, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5,
748 -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5},
749 -1.0, 1.0)));
750 EXPECT_THAT(m.GetOutputShape(), ElementsAreArray({1, 4, 7, 1}));
751}
752
753TEST_F(QuantizedPadV2OpTest, UInt8AdvancedConstValuedTest) {
754 AdvancedConstValuedTest<uint8_t, TensorType_UINT8>();

Callers

nothing calls this directly

Calls 3

DequantizedArrayNearFunction · 0.70
InvokeMethod · 0.45
GetOutputShapeMethod · 0.45

Tested by

no test coverage detected