import tensorflow as tf

        else:  # 创建worker两个网络的具体步骤
            with tf.variable_scope(scope):  # 这里的scope传入的是worker的名字
                self.global_step = globalAC.global_step
                self.obs_space = N_S
                self.act_space = N_A
                self.k = 16
                self.g_dim = 256
                self.c = 10
                self.vf_hidden_size = 128  # for value function network
                self.alpha = 0.5  # for build loss
                self.batch_processor = FeudalBatchProcessor(self.c)
                self.build_model()  # build feudal policy model

            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,具体计算在上面定义
                    # apply_gradients是tf.train.Optimizer中自带的功能函数，将求得的梯度参数更新到global中
            self.inc_step = self.global_step.assign_add(tf.shape(self.obs)[0])
            self.train_op = tf.group(self.update_params_op, self.inc_step)
            # GLOBALE_STEP += tf.shape(self.obs)[0]
