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

Function SimpleTest

tensorflow/lite/kernels/depthwise_conv_test.cc:318–343  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

316}
317
318void SimpleTest(TfLiteRegistration* registration, int num_thread) {
319 DepthwiseConvolutionOpModel m(registration,
320 {TensorType_FLOAT32, {1, 3, 2, 2}},
321 {TensorType_FLOAT32, {1, 2, 2, 4}},
322 {TensorType_FLOAT32, {}}, Padding_VALID);
323
324 m.SetInput({
325 1, 2, 7, 8, // column 1
326 3, 4, 9, 10, // column 2
327 5, 6, 11, 12, // column 3
328 });
329 m.SetFilter({
330 1, 2, 3, 4, //
331 -9, 10, -11, 12, //
332 5, 6, 7, 8, //
333 13, -14, 15, -16, //
334 });
335 m.SetBias({1, 2, 3, 4});
336
337 m.Invoke();
338
339 EXPECT_THAT(m.GetOutput(), ElementsAreArray({
340 71, -34, 99, -20, //
341 91, -26, 127, -4, //
342 }));
343}
344
345TEST_P(DepthwiseConvolutionOpTest, SimpleTest) {
346 SimpleTest(GetRegistration(), /*num_thread=*/1);

Callers 1

TEST_PFunction · 0.85

Calls 5

SetInputMethod · 0.45
SetFilterMethod · 0.45
SetBiasMethod · 0.45
InvokeMethod · 0.45
GetOutputMethod · 0.45

Tested by

no test coverage detected