mani_skill.utils.wrappers.cached_reset ====================================== .. py:module:: mani_skill.utils.wrappers.cached_reset Classes ------- .. autoapisummary:: mani_skill.utils.wrappers.cached_reset.CachedResetWrapper mani_skill.utils.wrappers.cached_reset.CachedResetsConfig Module Contents --------------- .. py:class:: CachedResetWrapper(env, reset_to_env_states = None, config = CachedResetsConfig()) Bases: :py:obj:`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. :param env: The environment to wrap. :param reset_to_env_states: 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. :param config: A dictionary or a `CachedResetsConfig` object that contains the configuration for the cached resets. .. py:method:: reset(*args, seed = None, options = None, **kwargs) Uses the :meth:`reset` of the :attr:`env` that can be overwritten to change the returned data. .. py:attribute:: _cached_resets_env_states .. py:attribute:: _num_cached_resets :value: 0 .. py:property:: base_env :type: mani_skill.envs.sapien_env.BaseEnv .. py:attribute:: cached_resets_config .. py:attribute:: num_envs .. py:class:: CachedResetsConfig .. py:attribute:: device :type: Optional[mani_skill.utils.structs.types.Device] :value: None The device to cache the reset states on. If none it will use the base environment's device. .. py:attribute:: num_resets :type: Optional[int] :value: None The number of reset states to cache. If none it will cache `num_envs` number of reset states. .. py:attribute:: seed :type: Optional[int] :value: None The seed to use for generating the cached reset states.