mani_skill.utils.wrappers.cached_reset#

Classes#

CachedResetWrapper

Cached reset wrapper for ManiSkill3 environments. Caching resets allows you to skip slower parts of the reset function call and boost environment FPS as a result.

CachedResetsConfig

Module Contents#

class mani_skill.utils.wrappers.cached_reset.CachedResetWrapper(env, reset_to_env_states=None, config=CachedResetsConfig())[source]#

Bases: gymnasium.Wrapper

Cached reset wrapper for ManiSkill3 environments. Caching resets allows you to skip slower parts of the reset function call and boost environment FPS as a result.

Parameters:
  • env (gymnasium.Env) – The environment to wrap.

  • reset_to_env_states (Optional[dict]) – A dictionary with keys “env_states” and optionally “obs”. “env_states” is a dictionary of environment states to reset to. “obs” contains the corresponding observations generated at those env states. If reset_to_env_states is not provided, the wrapper will sample reset states from the environment using the given seed.

  • config (Union[CachedResetsConfig, dict]) – A dictionary or a CachedResetsConfig object that contains the configuration for the cached resets.

reset(*args, seed=None, options=None, **kwargs)[source]#

Uses the reset() of the env that can be overwritten to change the returned data.

Parameters:
  • seed (Optional[Union[int, list[int]]]) –

  • options (Optional[dict]) –

_cached_resets_env_states[source]#
_num_cached_resets = 0[source]#
property base_env: mani_skill.envs.sapien_env.BaseEnv[source]#
Return type:

mani_skill.envs.sapien_env.BaseEnv

cached_resets_config[source]#
num_envs[source]#
class mani_skill.utils.wrappers.cached_reset.CachedResetsConfig[source]#
device: mani_skill.utils.structs.types.Device | None = None[source]#

The device to cache the reset states on. If none it will use the base environment’s device.

num_resets: int | None = None[source]#

The number of reset states to cache. If none it will cache num_envs number of reset states.

seed: int | None = None[source]#

The seed to use for generating the cached reset states.