From 2d6cca01221221b4462c506d7fc1074acbe7ede1 Mon Sep 17 00:00:00 2001 From: Renjie Liu Date: Mon, 5 Aug 2019 18:41:43 -0700 Subject: [PATCH] Fix depthwise_conv test. Looks somehow they are not really tested. :( PiperOrigin-RevId: 261816763 --- tensorflow/lite/kernels/depthwise_conv_test.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tensorflow/lite/kernels/depthwise_conv_test.cc b/tensorflow/lite/kernels/depthwise_conv_test.cc index 3a8a62c6804..75b4d5e6a61 100644 --- a/tensorflow/lite/kernels/depthwise_conv_test.cc +++ b/tensorflow/lite/kernels/depthwise_conv_test.cc @@ -616,6 +616,8 @@ class QuantizedDepthwiseConvolutionOpTest : public SingleOpTest { } }; +// Only enable this test for neon. +#ifdef USE_NEON TEST_F(QuantizedDepthwiseConvolutionOpTest, LargeOutputChannelTest) { const TensorData input({TensorType_UINT8, {1, 4, 4, 2400}, -63.5, 64}); const TensorData filter({TensorType_UINT8, {1, 3, 3, 2400}, -63.5, 64}); @@ -646,6 +648,7 @@ TEST_F(QuantizedDepthwiseConvolutionOpTest, LargeOutputChannelTest) { reference_impl.SetInput(input_data); reference_impl.SetFilter(filter_data); reference_impl.SetBias(bias_data); + reference_impl.Invoke(); QuantizedDepthwiseConvolutionOpModel optimized_impl( ops::builtin::Register_DEPTHWISE_CONVOLUTION_GENERIC_OPT(), input, filter, @@ -653,9 +656,11 @@ TEST_F(QuantizedDepthwiseConvolutionOpTest, LargeOutputChannelTest) { optimized_impl.SetInput(input_data); optimized_impl.SetFilter(filter_data); optimized_impl.SetBias(bias_data); + optimized_impl.Invoke(); - // EXPECT_THAT(reference_impl.GetOutput(), optimized_impl.GetOutput()); + EXPECT_THAT(reference_impl.GetOutput(), optimized_impl.GetOutput()); } +#endif // In this test we set the input and output scales so that the results match // exactly the 'non-quantized' version.