diff --git a/core/trainers/single_trainer.py b/core/trainers/single_trainer.py index abff7492ca00ca3f8ade076d6fd6fb8498dede70..305707d6bbb8aeffee24a36a92f7ccea05719642 100755 --- a/core/trainers/single_trainer.py +++ b/core/trainers/single_trainer.py @@ -248,10 +248,9 @@ class SingleTrainer(TranspileTrainer): _exe_strategy = fluid.ExecutionStrategy() # 0: kCoeffNumDevice; 1: One; 2: Customized + gradient_scale_strategy = fluid.BuildStrategy.GradientScaleStrategy.CoeffNumDevice _gradient_scale_strategy = model_dict.get("gradient_scale_strategy", 0) - if _gradient_scale_strategy == 0: - gradient_scale_strategy = fluid.BuildStrategy.GradientScaleStrategy.CoeffNumDevice - elif _gradient_scale_strategy == 1: + if _gradient_scale_strategy == 1: gradient_scale_strategy = fluid.BuildStrategy.GradientScaleStrategy.One elif _gradient_scale_strategy == 2: gradient_scale_strategy = fluid.BuildStrategy.GradientScaleStrategy.Customized