mirror of
https://github.com/ANL-CEEESA/MIPLearn.git
synced 2025-12-06 01:18:52 -06:00
Hdf5Sample: Store all fp arrays as float32
This commit is contained in:
@@ -178,8 +178,8 @@ class Hdf5Sample(Sample):
|
|||||||
if value is None:
|
if value is None:
|
||||||
return
|
return
|
||||||
self._assert_is_array(value)
|
self._assert_is_array(value)
|
||||||
if len(value.shape) > 1 and value.dtype.kind == "f":
|
if value.dtype.kind == "f":
|
||||||
value = value.astype("float16")
|
value = value.astype("float32")
|
||||||
if key in self.file:
|
if key in self.file:
|
||||||
del self.file[key]
|
del self.file[key]
|
||||||
return self.file.create_dataset(key, data=value, compression="gzip")
|
return self.file.create_dataset(key, data=value, compression="gzip")
|
||||||
|
|||||||
Reference in New Issue
Block a user