mirror of
https://github.com/wassname/ray.git
synced 2026-07-03 03:27:50 +08:00
fixing (#1048)
This commit is contained in:
committed by
Philipp Moritz
parent
2892955119
commit
54aaeb25ab
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user