Skip to content

Commit

Permalink
Revert "[Eager] Remove elementwise add in conv (PaddlePaddle#41515)"
Browse files Browse the repository at this point in the history
This reverts commit 33abfbe.
  • Loading branch information
Aurelius84 committed May 18, 2022
1 parent c16345c commit c995f97
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions python/paddle/nn/functional/conv.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,8 @@ def _conv_nd(x,
x, weight, stride, padding, padding_algorithm, groups, dilation,
data_format, False, -1, False)
if bias is not None:
channel_dim = channel_dim + len(
x.shape) if channel_dim < 0 else channel_dim
tmp_bias = _C_ops.final_state_reshape(
bias, bias.shape +
[1 for i in range(len(x.shape) - channel_dim - 1)])
return _C_ops.final_state_add(pre_bias, tmp_bias)
out = nn.elementwise_add(pre_bias, bias, axis=channel_dim)
return out
else:
return pre_bias
if in_dynamic_mode():
Expand Down

0 comments on commit c995f97

Please sign in to comment.