Skip to content

Commit aeccaf5

Browse files
authored
Merge pull request #4827 from pengli09/ensure-bias-attr-has-no-name
Ensure name is not set in bias_attr in gru_step_naive_layer
2 parents 436c0e0 + 98a6b85 commit aeccaf5

File tree

1 file changed

+6
-0
lines changed
  • python/paddle/trainer_config_helpers

1 file changed

+6
-0
lines changed

python/paddle/trainer_config_helpers/layers.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3679,6 +3679,12 @@ def gru_step_naive_layer(input,
36793679
if size is None:
36803680
size = input.size / 3
36813681

3682+
if bias_attr and bias_attr.attr.get("parameter_name", None) is not None:
3683+
raise ValueError("You should not specify the field `name` in bias_attr."
3684+
" Otherwise, the three biases, which correponding to "
3685+
" the two gates and the mixed layer for computing Wx+b"
3686+
", will share the same parameter matrix unexpectedly.")
3687+
36823688
def __gate__(gate_name, offset):
36833689
with mixed_layer(
36843690
name=name + "_" + gate_name,

0 commit comments

Comments
 (0)