opentau.envs.factory
This module contains factory methods to create environments based on their configuration.
Functions
|
Factory method to create an environment config based on the env_type. |
|
Makes a nested collection of gym vector environment according to the config. |
- opentau.envs.factory.make_env_config(env_type: str, **kwargs) EnvConfig[source]
Factory method to create an environment config based on the env_type. Supports ‘libero’ and ‘robocasa’.
- opentau.envs.factory.make_envs(cfg: EnvConfig, train_cfg: TrainPipelineConfig, n_envs: int = 1, use_async_envs: bool = False) dict[str, dict[int, VectorEnv]][source]
Makes a nested collection of gym vector environment according to the config.
- Parameters:
cfg (EnvConfig) – the config of the environment to instantiate.
n_envs (int, optional) – The number of parallelized env to return. Defaults to 1.
use_async_envs (bool, optional) – Whether to return an AsyncVectorEnv or a SyncVectorEnv. Defaults to False.
- Raises:
ValueError – if n_envs < 1
ModuleNotFoundError – If the requested env package is not installed
- Returns:
A mapping from suite name to indexed vectorized environments. - For multi-task benchmarks (e.g., LIBERO): one entry per suite, and one vec env per task_id. - For single-task environments: a single suite entry (cfg.type) with task_id=0.
- Return type:
dict[str, dict[int, gym.vector.VectorEnv]]