You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried the following code snippet, and it doesn't seem to work. Is this an already known issue?
>>> a = float8_e5m2(1.5)
>>> np.save("a.npy", a)
>>> b = np.load("a.npy")
Traceback (most recent call last):
File "/home/wonjeo01/.local/lib/python3.10/site-packages/numpy/lib/format.py", line 640, in _read_array_header
dtype = descr_to_dtype(d['descr'])
File "/home/wonjeo01/.local/lib/python3.10/site-packages/numpy/lib/format.py", line 309, in descr_to_dtype
return numpy.dtype(descr)
TypeError: data type '<f1' not understood
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/wonjeo01/.local/lib/python3.10/site-packages/numpy/lib/npyio.py", line 432, in load
return format.read_array(fid, allow_pickle=allow_pickle,
File "/home/wonjeo01/.local/lib/python3.10/site-packages/numpy/lib/format.py", line 765, in read_array
shape, fortran_order, dtype = _read_array_header(
File "/home/wonjeo01/.local/lib/python3.10/site-packages/numpy/lib/format.py", line 643, in _read_array_header
raise ValueError(msg.format(d['descr'])) from e
ValueError: descr is not a valid dtype descriptor: '<f1'
The text was updated successfully, but these errors were encountered:
Thanks - yeah this is a known issue (similar to what's reported in jax-ml/jax#8494).
Unfortunately, numpy's serialization only recognizes numpy's built-in dtypes, and the package currently offers no way to extend that. The best workaround for the time being would be something like this:
I tried the following code snippet, and it doesn't seem to work. Is this an already known issue?
The text was updated successfully, but these errors were encountered: