From 41d8bcdc060af09af68573d183097548a1094c26 Mon Sep 17 00:00:00 2001 From: Yu Yang Date: Wed, 14 Mar 2018 15:36:50 +0800 Subject: [PATCH] Fix models #725 --- python/paddle/fluid/optimizer.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/paddle/fluid/optimizer.py b/python/paddle/fluid/optimizer.py index 421963a2f91..8b8621469d8 100644 --- a/python/paddle/fluid/optimizer.py +++ b/python/paddle/fluid/optimizer.py @@ -223,6 +223,8 @@ class Optimizer(object): params_grads = append_backward(loss, parameter_list, no_grad_set, [error_clip_callback]) + params_grads = sorted(params_grads, key=lambda x: x[0].name) + params_grads = append_gradient_clip_ops(params_grads) # Add regularization if any -- GitLab