|
|
@ -229,15 +229,17 @@ class Conv2D(layers.Layer):
|
|
|
|
'use_mkldnn': False,
|
|
|
|
'use_mkldnn': False,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
pre_act = self._helper.create_variable_for_type_inference(
|
|
|
|
if self._bias_param is not None:
|
|
|
|
dtype=self._dtype)
|
|
|
|
pre_act = self._helper.create_variable_for_type_inference(
|
|
|
|
|
|
|
|
dtype=self._dtype)
|
|
|
|
self._helper.append_op(
|
|
|
|
self._helper.append_op(
|
|
|
|
type='elementwise_add',
|
|
|
|
type='elementwise_add',
|
|
|
|
inputs={'X': [pre_bias],
|
|
|
|
inputs={'X': [pre_bias],
|
|
|
|
'Y': [self._bias_param]},
|
|
|
|
'Y': [self._bias_param]},
|
|
|
|
outputs={'Out': [pre_act]},
|
|
|
|
outputs={'Out': [pre_act]},
|
|
|
|
attrs={'axis': 1})
|
|
|
|
attrs={'axis': 1})
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
pre_act = pre_bias
|
|
|
|
|
|
|
|
|
|
|
|
# Currently, we don't support inplace in dygraph mode
|
|
|
|
# Currently, we don't support inplace in dygraph mode
|
|
|
|
return self._helper.append_activation(pre_act, act=self._act)
|
|
|
|
return self._helper.append_activation(pre_act, act=self._act)
|
|
|
|