docstr: Args:
      algorithm (`parl.Algorithm`): a2c algorithm
      obs_shape (list/tuple): observation shape of atari environment
      predict_thread_num (int): number of predict thread (predict parallel exector)
      learn_data_provider: data generator of training
docstr_tok: ["Args",":","algorithm","(","`","parl.Algorithm","`",")",":","a2c","algorithm","obs_shape","(","list\/tuple",")",":","observation","shape","of","atari","environment","predict_thread_num","(","int",")",":","number","of","predict","thread","(","predict","parallel","exector",")","learn_data_provider",":","data","generator","of","training"]
code: def __init__(
      self,
      algorithm,
      obs_shape,
      predict_thread_num,
      learn_data_provider=None,
  ):
      """
  
      Args:
          algorithm (`parl.Algorithm`): a2c algorithm
          obs_shape (list/tuple): observation shape of atari environment
          predict_thread_num (int): number of predict thread (predict parallel exector)
          learn_data_provider: data generator of training
      """
  
      assert isinstance(obs_shape, (list, tuple))
      assert isinstance(predict_thread_num, int)
      self.obs_shape = obs_shape
  
      super(AtariAgent, self).__init__(algorithm)
  
      exec_strategy = fluid.ExecutionStrategy()
      exec_strategy.use_experimental_executor = True
      exec_strategy.num_threads = 4
      build_strategy = fluid.BuildStrategy()
      build_strategy.remove_unnecessary_lock = True
  
      # Use ParallelExecutor to make learn program run faster
      self.learn_exe = fluid.ParallelExecutor(
          use_cuda=machine_info.is_gpu_available(),
          loss_name=self.learn_outputs[0],
          main_program=self.learn_program,
          build_strategy=build_strategy,
          exec_strategy=exec_strategy,
      )
  
      self.sample_exes = []
      for _ in range(predict_thread_num):
          with fluid.scope_guard(fluid.global_scope().new_scope()):
              pe = fluid.ParallelExecutor(
                  use_cuda=machine_info.is_gpu_available(),
                  main_program=self.sample_program,
                  build_strategy=build_strategy,
                  exec_strategy=exec_strategy,
              )
              self.sample_exes.append(pe)
  
      if learn_data_provider:
          self.learn_reader.decorate_tensor_provider(
              learn_data_provider
          )
          self.learn_reader.start()
  
file_path: PARL/benchmark/fluid/GA3C/atari_agent.py
imports: import numpy
  import paddle.fluid
  import parl
  from parl import layers
  from parl.utils import machine_info
label_desc: Use image node_id 1 to create a new AtariAgent object from inherited base classes: parl with example: obj = AtariAgent(algorithm, obs_shape, predict_thread_num, learn_data_provider)