提交 f0431607 编写于 作者: S songyouwei 提交者: hong

cherry-pick #22373 (#22388)

test=release/1.7, test=develop
上级 90ce4aea
...@@ -182,13 +182,10 @@ class Conv2D(layers.Layer): ...@@ -182,13 +182,10 @@ class Conv2D(layers.Layer):
self._bias_attr = bias_attr self._bias_attr = bias_attr
self._dtype = dtype self._dtype = dtype
# TODO: recover the usage of depthwise_conv2d when it's if (self._num_channels == self._groups and
# kernel fixed https://github.com/PaddlePaddle/Paddle/issues/17098 num_filters % self._num_channels == 0 and not self._use_cudnn):
# if (self._num_channels == self._groups and self._l_type = 'depthwise_conv2d'
# num_filters % self._num_channels == 0 and not self._use_cudnn): else:
# self._l_type = 'depthwise_conv2d'
# else:
# self._l_type = 'conv2d'
self._l_type = 'conv2d' self._l_type = 'conv2d'
self._num_channels = num_channels self._num_channels = num_channels
...@@ -233,7 +230,7 @@ class Conv2D(layers.Layer): ...@@ -233,7 +230,7 @@ class Conv2D(layers.Layer):
'use_mkldnn': False, 'use_mkldnn': False,
} }
if in_dygraph_mode(): if in_dygraph_mode() and self._l_type == 'conv2d':
outs = core.ops.conv2d(inputs, attrs) outs = core.ops.conv2d(inputs, attrs)
pre_bias = outs['Output'][0] pre_bias = outs['Output'][0]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册