Tensorflow: How to convert NaNs to a number?
I think you need to use tf.select.
w = tf.select(tf.is_nan(w), tf.ones_like(w) * NUMBER, w); #if w is nan use 1 * NUMBER else use element in w
Update: TensorFlow 1.0 has deprecated tf.select
in favor of Numpy compatible tf.where
.