open depthwise_conv2d in dygraph (#22373)

test=develop
revert-22710-feature/integrated_ps_api
songyouwei 6 years ago committed by hong
parent ad2bc0c364
commit 39bdefd875

@ -183,14 +183,11 @@ class Conv2D(layers.Layer):
self._bias_attr = bias_attr
self._dtype = dtype
# TODO: recover the usage of depthwise_conv2d when it's
# kernel fixed https://github.com/PaddlePaddle/Paddle/issues/17098
# if (self._num_channels == self._groups and
# num_filters % self._num_channels == 0 and not self._use_cudnn):
# self._l_type = 'depthwise_conv2d'
# else:
# self._l_type = 'conv2d'
self._l_type = 'conv2d'
if (self._num_channels == self._groups and
num_filters % self._num_channels == 0 and not self._use_cudnn):
self._l_type = 'depthwise_conv2d'
else:
self._l_type = 'conv2d'
self._num_channels = num_channels
if self._groups is None:
@ -234,7 +231,7 @@ class Conv2D(layers.Layer):
'use_mkldnn': False,
}
if in_dygraph_mode():
if in_dygraph_mode() and self._l_type == 'conv2d':
outs = core.ops.conv2d(inputs, attrs)
pre_bias = outs['Output'][0]

Loading…
Cancel
Save