From cb65b56b13949353f6f8728d05721bd7419fd81c Mon Sep 17 00:00:00 2001 From: n+e Date: Tue, 16 Feb 2021 09:31:46 +0800 Subject: [PATCH] v0.3.2 (#292) Throw a warning in ListReplayBuffer. This version update is needed because of #289, the previous v0.3.1 cannot work well under torch<=1.6.0 with cuda environment. --- tianshou/__init__.py | 2 +- tianshou/data/buffer.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tianshou/__init__.py b/tianshou/__init__.py index 0f7a59c..380167b 100644 --- a/tianshou/__init__.py +++ b/tianshou/__init__.py @@ -1,7 +1,7 @@ from tianshou import data, env, utils, policy, trainer, exploration -__version__ = "0.3.1" +__version__ = "0.3.2" __all__ = [ "env", diff --git a/tianshou/data/buffer.py b/tianshou/data/buffer.py index 11d1ca1..1d36ce1 100644 --- a/tianshou/data/buffer.py +++ b/tianshou/data/buffer.py @@ -1,5 +1,6 @@ import h5py import torch +import warnings import numpy as np from numbers import Number from typing import Any, Dict, List, Tuple, Union, Optional @@ -412,6 +413,7 @@ class ListReplayBuffer(ReplayBuffer): def __init__(self, **kwargs: Any) -> None: super().__init__(size=0, ignore_obs_next=False, **kwargs) + warnings.warn("ListReplayBuffer will be removed in version 0.4.0.") def sample(self, batch_size: int) -> Tuple[Batch, np.ndarray]: raise NotImplementedError("ListReplayBuffer cannot be sampled!")