Support for torchrl envs

This commit is contained in:
2024-06-02 11:11:18 +02:00
parent 50733bb1a4
commit 0a95ea652a
2 changed files with 3 additions and 2 deletions
+2
View File
@@ -83,6 +83,8 @@ class OnPolicy(ABC):
env = env_spec()
if isinstance(env, gym.Env):
env = GymWrapper(env)
elif isinstance(env, gym.Env):
env = GymWrapper(env)
else:
raise ValueError("env_spec must be a string or a callable that returns an environment.")
return env