From 54aaeb25abfdccb6f18aa1c610c18c4b86880e6a Mon Sep 17 00:00:00 2001 From: Richard Liaw Date: Sun, 1 Oct 2017 22:34:55 -0700 Subject: [PATCH] fixing (#1048) --- python/ray/rllib/common.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/ray/rllib/common.py b/python/ray/rllib/common.py index 23b6e6da0..30a14b913 100644 --- a/python/ray/rllib/common.py +++ b/python/ray/rllib/common.py @@ -22,11 +22,13 @@ logger.setLevel(logging.INFO) class RLLibEncoder(json.JSONEncoder): def default(self, value): - if isinstance(value, np.float32) or isinstance(value, np.float64): + if np.issubdtype(value, float): if np.isnan(value): return None else: return float(value) + elif np.issubdtype(value, int): + return int(value) class RLLibLogger(object):