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

Function AdvancedConstTest

tensorflow/lite/kernels/pad_test.cc:381–392  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

379
380template <typename integer_type, TensorType tensor_dtype>
381void AdvancedConstTest() {
382 PadOpConstModel m({tensor_dtype, {1, 2, 3, 1}, -1.0, 1.0}, {4, 2},
383 {0, 0, 0, 2, 1, 3, 0, 0}, {tensor_dtype, {}, -1.0, 1.0});
384 m.template SetQuantizedInput<integer_type>({-0.8, 0.2, 0.9, 0.7, 0.1, -0.3});
385 m.Invoke();
386 EXPECT_THAT(m.template GetDequantizedOutput<integer_type>(),
387 ElementsAreArray(DequantizedArrayNear(
388 {0, -0.8, 0.2, 0.9, 0, 0, 0, 0, 0.7, 0.1, -0.3, 0, 0, 0,
389 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
390 -1.0, 1.0)));
391 EXPECT_THAT(m.GetOutputShape(), ElementsAreArray({1, 4, 7, 1}));
392}
393
394TEST_F(QuantizedPadOpTest, UInt8AdvancedConstTest) {
395 AdvancedConstTest<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