autopep8
This commit is contained in:
@@ -25,9 +25,9 @@ class NotSteppingError(Exception):
|
|||||||
|
|
||||||
class VecEnv(ABC):
|
class VecEnv(ABC):
|
||||||
"""
|
"""
|
||||||
An abstract asynchronous, vectorized environment.
|
An abstract asynchronous, vectorized environment.
|
||||||
Used to batch data from multiple copies of an environment, so that
|
Used to batch data from multiple copies of an environment, so that
|
||||||
each observation becomes an batch of observations, and expected action is a batch of actions to
|
each observation becomes an batch of observations, and expected action is a batch of actions to
|
||||||
be applied per-environment.
|
be applied per-environment.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@@ -7,14 +7,14 @@ class DummyVecEnv(VecEnv):
|
|||||||
"""
|
"""
|
||||||
VecEnv that does runs multiple environments sequentially, that is,
|
VecEnv that does runs multiple environments sequentially, that is,
|
||||||
the step and reset commands are send to one environment at a time.
|
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,
|
Useful when debugging and when num_env == 1 (in the latter case,
|
||||||
avoids communication overhead)
|
avoids communication overhead)
|
||||||
"""
|
"""
|
||||||
def __init__(self, env_fns):
|
def __init__(self, env_fns):
|
||||||
"""
|
"""
|
||||||
Arguments:
|
Arguments:
|
||||||
|
|
||||||
env_fns: iterable of callables functions that build environments
|
env_fns: iterable of callables functions that build environments
|
||||||
"""
|
"""
|
||||||
self.envs = [fn() for fn in env_fns]
|
self.envs = [fn() for fn in env_fns]
|
||||||
env = self.envs[0]
|
env = self.envs[0]
|
||||||
|
@@ -33,8 +33,8 @@ def worker(remote, parent_remote, env_fn_wrapper):
|
|||||||
|
|
||||||
class SubprocVecEnv(VecEnv):
|
class SubprocVecEnv(VecEnv):
|
||||||
"""
|
"""
|
||||||
VecEnv that runs multiple environments in parallel in subproceses and communicates with them via pipes.
|
VecEnv that runs multiple environments in parallel in subproceses and communicates with them via pipes.
|
||||||
Recommended to use when num_envs > 1 and step() can be a bottleneck.
|
Recommended to use when num_envs > 1 and step() can be a bottleneck.
|
||||||
"""
|
"""
|
||||||
def __init__(self, env_fns, spaces=None):
|
def __init__(self, env_fns, spaces=None):
|
||||||
"""
|
"""
|
||||||
|
Reference in New Issue
Block a user