import tensorflow as tf


            with tf.name_scope('local_grad'):
                grads = tf.gradients(self.loss, self.var_list)
                grads, _ = tf.clip_by_global_norm(grads, 40)

            with tf.name_scope('sync'):  # worker和global的同步过程
                with tf.name_scope('pull'):  # 获取global参数,复制到local—net
                    self.pull_params_op = tf.group(*[v1.assign(v2)
                                                     for v1, v2 in zip(self.var_list, globalAC.var_list)])
                with tf.name_scope('push'):  # 将参数传送到gloabl中去
                    self.update_params_op = OPT.apply_gradients(zip(grads, globalAC.var_list))
                    # 其中传送的是local—net的actor和critic的参数梯度grads,具体计算在上面定义
