diff --git a/python/paddle/nn/layer/conv.py b/python/paddle/nn/layer/conv.py index 1c971c024a94078c57eca6804bce6776e70bcca1..279f0648db18498de3d182fc0e8905c841f5cd80 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