Re-enable half-precision; minor changes to FeaturesExtractor benchmark

This commit is contained in:
2021-08-10 11:02:02 -05:00
parent 9cfb31bacb
commit a65ebfb17c
2 changed files with 9 additions and 7 deletions

View File

@@ -174,6 +174,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 key in self.file:
del self.file[key]
return self.file.create_dataset(key, data=value, compression="gzip")