diff --git a/python/paddle/fluid/layers/nn.py b/python/paddle/fluid/layers/nn.py index 5b28f141d3d1a48cc2fecc0f56d40af6a11a0b76..d497662f190061a96b869e6b8ad33225bc7fd22e 100644 --- a/python/paddle/fluid/layers/nn.py +++ b/python/paddle/fluid/layers/nn.py @@ -868,12 +868,11 @@ def dropout(x, if (seed is None or seed == 0) and default_main_program().random_seed != 0: seed = default_main_program().random_seed - seed = seed if seed is not None else 0 _is_test = not _dygraph_tracer()._train_mode - out, mask = core.ops.dropout(x, 'dropout_prob', dropout_prob, 'is_test', - _is_test, 'fix_seed', seed is not None, - 'seed', seed, 'dropout_implementation', - dropout_implementation) + out, mask = core.ops.dropout( + x, 'dropout_prob', dropout_prob, 'is_test', _is_test, 'fix_seed', + seed is not None, 'seed', seed if seed is not None else 0, + 'dropout_implementation', dropout_implementation) return out helper = LayerHelper('dropout', **locals())