[tune] np.array compat for logger (#8918)

Co-authored-by: Richard Liaw <rliaw@berkeley.edu>
This commit is contained in:
Eli Meirom
2020-06-13 02:39:01 +03:00
committed by GitHub
parent 0e82f0d7c3
commit 5c56760fac
+3 -1
View File
@@ -218,7 +218,9 @@ class TBXLogger(Logger):
valid_result[full_attr] = value
self._file_writer.add_scalar(
full_attr, value, global_step=step)
elif type(value) in [list, np.ndarray] and len(value) > 0:
elif (type(value) == list
and len(value) > 0) or (type(value) == np.ndarray
and value.size > 0):
valid_result[full_attr] = value
try:
self._file_writer.add_histogram(