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

Function AdvancedConstTestV2

tensorflow/lite/kernels/pad_test.cc:641–654  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

639
640template <typename integer_type, TensorType tensor_dtype>
641void AdvancedConstTestV2() {
642 PadV2OpConstModel<integer_type> m(
643 {tensor_dtype, {1, 2, 3, 1}, -1.0, 1.0}, {4, 2}, {0, 0, 0, 2, 1, 3, 0, 0},
644 {tensor_dtype, {1}, -1.0, 1.0}, {tensor_dtype, {}, -1.0, 1.0});
645 m.template SetQuantizedInput<integer_type>({-0.8, 0.2, 0.9, 0.7, 0.1, -0.3});
646 m.template SetQuantizedPadValue<integer_type>(0);
647 m.Invoke();
648 EXPECT_THAT(m.template GetDequantizedOutput<integer_type>(),
649 ElementsAreArray(DequantizedArrayNear(
650 {0, -0.8, 0.2, 0.9, 0, 0, 0, 0, 0.7, 0.1, -0.3, 0, 0, 0,
651 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
652 -1.0, 1.0)));
653 EXPECT_THAT(m.GetOutputShape(), ElementsAreArray({1, 4, 7, 1}));
654}
655
656TEST_F(QuantizedPadV2OpTest, UInt8AdvancedConstTest) {
657 AdvancedConstTestV2<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