From 7b94934a86eb60eedadf242eb8285e3879a70a4d Mon Sep 17 00:00:00 2001 From: LielinJiang <50691816+LielinJiang@users.noreply.github.com> Date: Thu, 3 Dec 2020 10:13:25 +0800 Subject: [PATCH] fix depthwise conv (#29227) (#29307) --- python/paddle/nn/layer/conv.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/python/paddle/nn/layer/conv.py b/python/paddle/nn/layer/conv.py index 1c971c024a..279f0648db 100644 --- a/python/paddle/nn/layer/conv.py +++ b/python/paddle/nn/layer/conv.py @@ -143,9 +143,10 @@ class _ConvNd(layers.Layer): cudnn_version is not None) else False self._op_type = "conv" + str(dims) + 'd' - if dims == 2 and (in_channels == groups and in_channels != 1 and - out_channels % in_channels == 0): - self.op_type = 'depthwise_conv2d' + if self._op_type == 'conv2d' and (in_channels == groups and + in_channels != 1 and + out_channels % in_channels == 0): + self._op_type = 'depthwise_conv2d' self._use_cudnn = False -- GitLab