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
Have I written custom code (as opposed to using a stock example script provided in TensorFlow): no
OS Platform and Distribution: Linux Ubuntu 18.04
TensorFlow installed from (source or binary): binary (pip install)
TensorFlow version (use command below): v2.1.0-rc2-17-ge5bf8de 2.1.0, v2.0.0-rc2-26-g64c3d38 2.0.0
Python version: 3.7
Describe the current behavior
tf.cast() on a python float (e.g, a literal float constant, not a numpy float/array type) does an implicit conversion to the TensorFlow default dtype tf.float32, which can result in loss of precision when intending to cast to tf.float64:
Other info / logs
This was discovered as a bug in GPflow, which we built a work-around for in GPflow/GPflow#1211 - but this is a pervading issue, and it would be good to fix this upstream instead of having to write and use a gpflow.cast() everywhere just to work around having potentially passed in a python float.
The text was updated successfully, but these errors were encountered:
This is related to tensorflow#26033 - not having to support our own "default dtype" implementation would remove the need for a lot of the calls to tf.cast.
Describe the current behavior
tf.cast()
on a python float (e.g, a literal float constant, not a numpy float/array type) does an implicit conversion to the TensorFlow default dtype tf.float32, which can result in loss of precision when intending to cast to tf.float64:Describe the expected behavior
Code to reproduce the issue
See above.
Other info / logs
This was discovered as a bug in GPflow, which we built a work-around for in GPflow/GPflow#1211 - but this is a pervading issue, and it would be good to fix this upstream instead of having to write and use a
gpflow.cast()
everywhere just to work around having potentially passed in a python float.The text was updated successfully, but these errors were encountered: