From 2b00cf5b960a692bedc6263954cf5e461c103dc6 Mon Sep 17 00:00:00 2001 From: Alinson S Xavier Date: Thu, 12 Aug 2021 07:51:59 -0500 Subject: [PATCH] Hdf5Sample: Store all fp arrays as float32 --- miplearn/features/sample.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/miplearn/features/sample.py b/miplearn/features/sample.py index 50d9f72..a0d6e43 100644 --- a/miplearn/features/sample.py +++ b/miplearn/features/sample.py @@ -178,8 +178,8 @@ class Hdf5Sample(Sample): if value is None: return self._assert_is_array(value) - if len(value.shape) > 1 and value.dtype.kind == "f": - value = value.astype("float16") + if value.dtype.kind == "f": + value = value.astype("float32") if key in self.file: del self.file[key] return self.file.create_dataset(key, data=value, compression="gzip")