Closed axelboc closed 7 months ago
Sorry, took a while to get back to this and I would need some context to refresh my mind.
Why using
dtype=safe
makes it possible to fetch float16 and float128 as binary ?
No worries!
There's no Float16Array
and Float128Array
in JS, so if we fetched float16/128 datasets with format=bin
without dtype=safe
, we'd get binary we don't understand (at least without using custom libraries like https://github.com/petamoriken/float16 or https://github.com/munrocket/double.js).
When fetching float16/128 datasets with format=bin
and dtype=safe
, h5grove converts them to float32/64 respectively. With this knowledge, we can adjust our provider logic to say that when fetching float16, the response buffer should be passed into a Float32Array
and when fetching float128, into a Float64Array
. (Before, we were saying that float16/128 datasets had no corresponding typed array, which led to fetching them as JSON).
Sorry, took a while to get back to this and I would need some context to refresh my mind.
Why using
dtype=safe
makes it possible to fetch float16 and float128 as binary ?