diff --git a/python/paddle/fluid/layers/nn.py b/python/paddle/fluid/layers/nn.py index b872fc1ebc6ef84a92c52cb1a3992907c44470f7..ff2dd0811115793b55e0ac6ca382f91a26a2ac09 100644 --- a/python/paddle/fluid/layers/nn.py +++ b/python/paddle/fluid/layers/nn.py @@ -983,12 +983,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())