We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What is the best work around for supporting float64 objects?
import numpy as np from omegaconf import OmegaConf d = OmegaConf.create(dict(a=np.float64(3.2))) d
raises
Value 'float64' is not a supported primitive type
The text was updated successfully, but these errors were encountered:
Well float64 and python float are c doubles underneath, so one should not lose info by converting to/from python floats, like:
d = OmegaConf.create(dict(a=np.float64(3.2).item()))
Alternatively if you didn't mind conversion overhead but wanted a non lossy intermediate string representation, one could use hex float strings like:
d = OmegaConf.create(dict(a=np.float64(3.2).hex()))
Sorry, something went wrong.
np.floats are not supported by OmegaConf. as @pixelb pointed out you have to convert them to a python float.
np.floats
float
There is a feature request to attempt supporting them by casting them to float (#725).
bytes
No branches or pull requests
What is the best work around for supporting float64 objects?
raises
The text was updated successfully, but these errors were encountered: