code: def __init__(self, config):
      # the cluster may not have gpu
      self.device = torch.device(
          "cuda" if torch.cuda.is_available() else "cpu"
      )
      self.config = config
      self.envs = []
      for _ in range(config["env_num"]):
          env = gym.make(config["env_name"])
          env = wrap_deepmind(
              env, dim=config["env_dim"], obs_format="NCHW"
          )
          self.envs.append(env)
      self.vector_env = VectorEnv(self.envs)
  
      self.obs_batch = self.vector_env.reset()
  
      obs_shape = env.observation_space.shape
      act_dim = env.action_space.n
  
      self.config["obs_shape"] = obs_shape
      self.config["act_dim"] = act_dim
  
      model = ActorCritic(act_dim)
  
      model = model.to(self.device)
  
      algorithm = A2C(model, config)
      self.agent = Agent(algorithm, config)
  
file_path: PARL/benchmark/torch/a2c/actor.py
imports: import os
  import gym
  import parl
  import torch
  import numpy
  from collections import defaultdict
  from parl.env.atari_wrappers import wrap_deepmind, MonitorEnv, get_wrapper_by_cls
  from parl.env.vector_env import VectorEnv
  from parl.utils.rl_utils import calc_gae
  from atari_model import ActorCritic
  from parl.algorithms import A2C
  from atari_agent import Agent
label_desc: Use image node_id 1 to create a new Actor object from inherited base classes: object with example: obj = Actor(config)