docstr: 1.setting latest_params to each actor model
  2.getting the sample data from all the actors synchronizely
  3.training the model with the sample data and the params is upgraded, and goto step 1
docstr_tok: ["1.setting","latest_params","to","each","actor","model","2.getting","the","sample","data","from","all","the","actors","synchronizely","3.training","the","model","with","the","sample","data","and","the","params","is","upgraded",",","and","goto","step","1"]
code: def step(self):
      """
      1.setting latest_params to each actor model
      2.getting the sample data from all the actors synchronizely
      3.training the model with the sample data and the params is upgraded, and goto step 1
      """
  
      latest_params = self.agent.get_weights()
      # setting the actor to the latest_params
      for remote_actor in self.remote_actors:
          remote_actor.set_weights(latest_params)
  
      train_batch = defaultdict(list)
      # get the total train data of all the actors.
      future_object_ids = [
          remote_actor.sample() for remote_actor in self.remote_actors
      ]
      sample_datas = [
          future_object.get() for future_object in future_object_ids
      ]
      for sample_data in sample_datas:
          for key, value in sample_data.items():
              train_batch[key].append(value)
          self.sample_total_steps += len(sample_data["obs"])
  
      for key, value in train_batch.items():
          train_batch[key] = np.concatenate(value)
      with self.learn_time_stat:
          (
              total_loss,
              pi_loss,
              vf_loss,
              entropy,
              lr,
              entropy_coeff,
          ) = self.agent.learn(
              obs=train_batch["obs"],
              actions=train_batch["actions"],
              advantages=train_batch["advantages"],
              target_values=train_batch["target_values"],
          )
  
      self.total_loss_stat.add(total_loss)
      self.pi_loss_stat.add(pi_loss)
      self.vf_loss_stat.add(vf_loss)
      self.entropy_stat.add(entropy)
      self.lr = lr
      self.entropy_coeff = entropy_coeff
  
imports: import torch
  import gym
  import parl
  import time
  import numpy
  from collections import defaultdict
  from parl.env.atari_wrappers import wrap_deepmind
  from parl.utils.window_stat import WindowStat
  from parl.utils.time_stat import TimeStat
  from parl.utils import logger, summary
  from parl.algorithms import A2C
  from atari_model import ActorCritic
  from atari_agent import Agent
  from actor import Actor
label_desc: Use image node_id 3 for calling the Learner obj's underlying member method code with example usage: obj.step() without return types