Experimental wrapper changes (#517)

This commit is contained in:
Mark Towers
2023-05-23 15:46:04 +01:00
committed by GitHub
parent 22a00c2a75
commit 5bf6c1e93f
15 changed files with 541 additions and 253 deletions

View File

@@ -111,13 +111,13 @@ class NumpyToTorchV0(gym.Wrapper, gym.utils.RecordConstructorArgs):
def step(
self, action: WrapperActType
) -> tuple[WrapperObsType, SupportsFloat, bool, bool, dict]:
"""Performs the given action within the environment.
"""Using a PyTorch based action that is converted to NumPy to be used by the environment.
Args:
action: The action to perform as a PyTorch Tensor
action: A PyTorch-based action
Returns:
The next observation, reward, termination, truncation, and extra info
The PyTorch-based Tensor next observation, reward, termination, truncation, and extra info
"""
jax_action = torch_to_numpy(action)
obs, reward, terminated, truncated, info = self.env.step(jax_action)