stable-baselines3/stable_baselines3/__init__.py
Quentin Gallouédec ca944fed2d
Update version (#1220)
* Replace .to(device) when possible

* fix numpy dep

* black

* Add warning for device != cpu and copy=False

* Update changelog

* Remove warning

* Update buffers.py

* Update version

* Fix type checking

Co-authored-by: Antonin RAFFIN <antonin.raffin@ensta.org>
2022-12-19 13:53:00 +01:00

40 lines
1.1 KiB
Python

import os
import numpy as np
from stable_baselines3.a2c import A2C
from stable_baselines3.common.utils import get_system_info
from stable_baselines3.ddpg import DDPG
from stable_baselines3.dqn import DQN
from stable_baselines3.her.her_replay_buffer import HerReplayBuffer
from stable_baselines3.ppo import PPO
from stable_baselines3.sac import SAC
from stable_baselines3.td3 import TD3
# Small monkey patch so gym 0.21 is compatible with numpy >= 1.24
# TODO: remove when upgrading to gym 0.26
np.bool = bool # type: ignore[attr-defined]
# Read version from file
version_file = os.path.join(os.path.dirname(__file__), "version.txt")
with open(version_file) as file_handler:
__version__ = file_handler.read().strip()
def HER(*args, **kwargs):
raise ImportError(
"Since Stable Baselines 2.1.0, `HER` is now a replay buffer class `HerReplayBuffer`.\n "
"Please check the documentation for more information: https://stable-baselines3.readthedocs.io/"
)
__all__ = [
"A2C",
"DDPG",
"DQN",
"PPO",
"SAC",
"TD3",
"HerReplayBuffer",
"get_system_info",
]