test=develop, fix con2d with no bias (#17516)

* test=develop, fix con2d with no bias

* test=develop, fix conv_2d with no bias will have null shape
fix_ema
Jiabin Yang 6 years ago committed by GitHub
parent f86f49e779
commit ff5fdc0b67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

Loading…
Cancel
Save