From ea13922cf19c620dcbe870fa7fd6432c196e7192 Mon Sep 17 00:00:00 2001 From: Renjie Liu Date: Tue, 18 Feb 2020 18:57:20 -0800 Subject: [PATCH] Remove the depthwise conv 3x3 output shift > 0 restriction for per-channel. (it's a obsolete restriction), we're using sqrshl, so it's fine to handle output_shift <= 0 case. PiperOrigin-RevId: 295873865 Change-Id: I20ef4ea4c70fd00c2a2d1fc75730ac0fbd807faf --- .../internal/optimized/depthwiseconv_3x3_filter_common.h | 9 --------- 1 file changed, 9 deletions(-) diff --git a/tensorflow/lite/kernels/internal/optimized/depthwiseconv_3x3_filter_common.h b/tensorflow/lite/kernels/internal/optimized/depthwiseconv_3x3_filter_common.h index e27e3d7b272..f7860e29e69 100644 --- a/tensorflow/lite/kernels/internal/optimized/depthwiseconv_3x3_filter_common.h +++ b/tensorflow/lite/kernels/internal/optimized/depthwiseconv_3x3_filter_common.h @@ -453,7 +453,6 @@ inline bool Fast3x3FilterKernelSupported( const int32 filter_width = filter_shape.Dims(2); const int32 output_height = output_shape.Dims(1); const int32 output_width = output_shape.Dims(2); - const int32 output_depth = output_shape.Dims(3); bool supported = filter_width == 3 && filter_height == 3 && depth_multiplier == 1 && @@ -468,14 +467,6 @@ inline bool Fast3x3FilterKernelSupported( return false; } - if (quantization_type == QuantizationType::kPerChannelInt8) { - for (int i = 0; i < output_depth; ++i) { - if (output_shift_ptr[i] > 0) { - return false; - } - } - } - // Handle case where padding is zero but padding type is not kValid. // This would require special boundary case handling that is not supported.