class_docstr: VecEnv that does runs multiple environments sequentially, that is,
  the step and reset commands are send to one environment at a time.
  Useful when debugging and when num_env == 1 (in the latter case,
  avoids communication overhead)
class_docstr_tok: ["VecEnv","that","does","runs","multiple","environments","sequentially",",","that","is",",","the","step","and","reset","commands","are","send","to","one","environment","at","a","time",".","Useful","when","debugging","and","when","num_env","==","1","(","in","the","latter","case",",","avoids","communication","overhead",")"]
docstr: Arguments:
  
  env_fns: iterable of callables      functions that build environments
docstr_tok: ["Arguments",":","env_fns",":","iterable","of","callables","functions","that","build","environments"]
code: def __init__(self, env_fns):
      """
      Arguments:
  
      env_fns: iterable of callables      functions that build environments
      """
      self.envs = [fn() for fn in env_fns]
      env = self.envs[0]
      VecEnv.__init__(
          self, len(env_fns), env.observation_space, env.action_space
      )
      obs_space = env.observation_space
      self.keys, shapes, dtypes = obs_space_info(obs_space)
  
      self.buf_obs = {
          k: np.zeros(
              (self.num_envs,) + tuple(shapes[k]), dtype=dtypes[k]
          )
          for k in self.keys
      }
      self.buf_dones = np.zeros((self.num_envs,), dtype=np.bool)
      self.buf_rews = np.zeros((self.num_envs,), dtype=np.float32)
      self.buf_infos = [{} for _ in range(self.num_envs)]
      self.actions = None
      self.spec = self.envs[0].spec
  
file_path: baselines/baselines/common/vec_env/dummy_vec_env.py
imports: import numpy
  from .vec_env import VecEnv
  from .util import copy_obs_dict, dict_to_obs, obs_space_info
label_desc: Use image node_id 1 to create a new DummyVecEnv object from inherited base classes: VecEnv with example: obj = DummyVecEnv(env_fns)