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

Function StrideTest

tensorflow/lite/kernels/depthwise_conv_test.cc:241–269  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239}
240
241void StrideTest(TfLiteRegistration* registration, int num_thread) {
242 DepthwiseConvolutionOpModel m(
243 registration, {TensorType_FLOAT32, {1, 3, 2, 2}},
244 {TensorType_FLOAT32, {1, 2, 2, 4}}, {TensorType_FLOAT32, {}},
245 Padding_VALID,
246 /*dilation_factor*/ 1,
247 /*stride_width*/ 2,
248 /*stride_height*/ 2,
249 /*ActivationFunctionType*/ ActivationFunctionType_NONE);
250
251 m.SetInput({
252 1, 2, 7, 8, // column 1
253 3, 4, 9, 10, // column 2
254 5, 6, 11, 12, // column 3
255 });
256 m.SetFilter({
257 1, 2, 3, 4, //
258 -9, 10, -11, 12, //
259 5, 6, 7, 8, //
260 13, -14, 15, -16, //
261 });
262 m.SetBias({1, 2, 3, 4});
263
264 m.Invoke();
265
266 EXPECT_THAT(m.GetOutput(), ElementsAreArray({
267 71, -34, 99, -20, //
268 }));
269}
270
271TEST_P(DepthwiseConvolutionOpTest, StrideTest) {
272 StrideTest(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