Skip to content

Commit

Permalink
Remove gym from skrl.memories
Browse files Browse the repository at this point in the history
  • Loading branch information
Toni-SM committed Oct 26, 2024
1 parent a2b322b commit 10cd3a6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 3 additions & 4 deletions skrl/memories/jax/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import functools
import operator
import os
import gym
import gymnasium

import jax
Expand Down Expand Up @@ -160,7 +159,7 @@ def set_tensor_by_name(self, name: str, tensor: Union[np.ndarray, jax.Array]) ->

def create_tensor(self,
name: str,
size: Union[int, Tuple[int], gym.Space, gymnasium.Space],
size: Union[int, Tuple[int], gymnasium.Space],
dtype: Optional[np.dtype] = None,
keep_dimensions: bool = False) -> bool:
"""Create a new internal tensor in memory
Expand All @@ -171,8 +170,8 @@ def create_tensor(self,
:param name: Tensor name (the name has to follow the python PEP 8 style)
:type name: str
:param size: Number of elements in the last dimension (effective data size).
The product of the elements will be computed for sequences or gym/gymnasium spaces
:type size: int, tuple or list of integers or gym.Space
The product of the elements will be computed for sequences or gymnasium spaces
:type size: int, tuple or list of integers or gymnasium space
:param dtype: Data type (np.dtype) (default: ``None``).
If None, the global default jax.numpy.float32 data type will be used
:type dtype: np.dtype or None, optional
Expand Down
7 changes: 3 additions & 4 deletions skrl/memories/torch/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import functools
import operator
import os
import gym
import gymnasium

import numpy as np
Expand Down Expand Up @@ -128,7 +127,7 @@ def set_tensor_by_name(self, name: str, tensor: torch.Tensor) -> None:

def create_tensor(self,
name: str,
size: Union[int, Tuple[int], gym.Space, gymnasium.Space],
size: Union[int, Tuple[int], gymnasium.Space],
dtype: Optional[torch.dtype] = None,
keep_dimensions: bool = False) -> bool:
"""Create a new internal tensor in memory
Expand All @@ -139,8 +138,8 @@ def create_tensor(self,
:param name: Tensor name (the name has to follow the python PEP 8 style)
:type name: str
:param size: Number of elements in the last dimension (effective data size).
The product of the elements will be computed for sequences or gym/gymnasium spaces
:type size: int, tuple or list of integers, gym.Space, or gymnasium.Space
The product of the elements will be computed for sequences or gymnasium spaces
:type size: int, tuple or list of integers or gymnasium space
:param dtype: Data type (torch.dtype) (default: ``None``).
If None, the global default torch data type will be used
:type dtype: torch.dtype or None, optional
Expand Down

0 comments on commit 10cd3a6

Please sign in to comment.