tensorflow-probabilitydtypeprobabilistic-programming

How can I change the dtype of a distribution in Tensorflow Probability?


Is there any possibility of changing the dtype of a tensorflow_probability.distribution, either on instantiation or with a respective setter()?

I want to use tf.float64 instead of the standard tf.float32 but could not find any way to do this, since the dtype-attribute is not directly accessible and tf.cast() does not work on it.


Solution

  • You generally just need to pass some numerical parameter explicitly, tf.cast or np.cast to f64.