Skip to content

Commit fec0b19

Browse files
committed
fix unit test
test=develop
1 parent a20f8e2 commit fec0b19

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

python/paddle/fluid/optimizer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ def _create_optimization_pass(self,
227227
self.helper = LayerHelper(self.__class__.__name__)
228228
self._create_accumulators(loss.block,
229229
[p[0] for p in parameters_and_grads])
230+
self._create_global_learning_rate()
230231

231232
optimize_ops = []
232233
for param_and_grad in parameters_and_grads:
@@ -268,6 +269,7 @@ def _process_distribute_lookuptable(self, param_grads, loss,
268269
param_and_grad = [table_param, table_grad]
269270
with table_param.block.program._optimized_guard(param_and_grad), \
270271
framework.name_scope("optimizer"):
272+
self._create_global_learning_rate()
271273
# create the optimize op
272274
sgd_op = loss.block.append_op(
273275
type='sgd',
@@ -291,7 +293,6 @@ def minimize(self,
291293
`create_optimization_pass()` into one.
292294
"""
293295
with program_guard(loss.block.program, startup_program):
294-
self._create_global_learning_rate()
295296

296297
params_grads = append_backward(loss, parameter_list, no_grad_set,
297298
[error_clip_callback])

0 commit comments

Comments
 (0)