Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refer to numpy instead of jax [for vars and docs] in vector NumpyToTorch #1319

Merged
merged 1 commit into from
Mar 4, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions gymnasium/wrappers/vector/numpy_to_torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def __init__(self, env: VectorEnv, device: Device | None = None):
"""Wrapper class to change inputs and outputs of environment to PyTorch tensors.

Args:
env: The Jax-based vector environment to wrap
env: The NumPy-based vector environment to wrap
device: The device the torch Tensors should be moved to
"""
super().__init__(env)
Expand All @@ -60,8 +60,8 @@ def step(
Returns:
The PyTorch-based Tensor next observation, reward, termination, truncation, and extra info
"""
jax_action = torch_to_numpy(actions)
obs, reward, terminated, truncated, info = self.env.step(jax_action)
numpy_action = torch_to_numpy(actions)
obs, reward, terminated, truncated, info = self.env.step(numpy_action)

return (
numpy_to_torch(obs, self.device),
Expand All @@ -81,7 +81,7 @@ def reset(

Args:
seed: The seed for resetting the environment
options: The options for resetting the environment, these are converted to jax arrays.
options: The options for resetting the environment, these are converted to NumPy arrays.

Returns:
PyTorch-based observations and info
Expand Down
Loading