diff --git a/python/paddle/fluid/layers/nn.py b/python/paddle/fluid/layers/nn.py index 4d8f887cbaa751eb8eda83c8ec3e45cf137366b8..f4f462ec3bbae03a8f5e87e3083a0ee26a51a72b 100644 --- a/python/paddle/fluid/layers/nn.py +++ b/python/paddle/fluid/layers/nn.py @@ -6689,6 +6689,7 @@ def clip_by_norm(x, max_norm, name=None): out = helper.create_variable( name=name, dtype=x.dtype, persistable=False) + # max_norm should always be set helper.append_op( type="clip_by_norm", inputs={"X": x},