Skip to content

Commit

Permalink
Close the environment in the base class and add render return annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
Toni-SM committed Aug 3, 2024
1 parent 1c6b53a commit ae66fe7
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions skrl/envs/wrappers/torch/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,18 @@ def step(self, actions: torch.Tensor) -> Tuple[torch.Tensor, torch.Tensor, torch
"""
raise NotImplementedError

def render(self, *args, **kwargs) -> None:
def render(self, *args, **kwargs) -> Any:
"""Render the environment
:return: Any value from the wrapped environment
:rtype: any
"""
pass
return None

def close(self) -> None:
"""Close the environment
"""
pass
self._env.close()

@property
def num_envs(self) -> int:
Expand Down Expand Up @@ -168,15 +171,18 @@ def step(self, actions: Mapping[str, torch.Tensor]) -> \
"""
raise NotImplementedError

def render(self, *args, **kwargs) -> None:
def render(self, *args, **kwargs) -> Any:
"""Render the environment
:return: Any value from the wrapped environment
:rtype: any
"""
pass
return None

def close(self) -> None:
"""Close the environment
"""
pass
self._env.close()

@property
def num_envs(self) -> int:
Expand Down

0 comments on commit ae66fe7

Please sign in to comment.