This is probably a basic question, but I can't find a solution:
I need to calculate the mean of a tensor ignoring any non-finite values.
For example mean([2.0, 3.0, inf, 5.0])
should return 3.333
and not inf
nor 2.5
.
I have tried sess.run(tf.reduce_mean([2.0, 3.0, inf, 5.0]))
but it returns inf
.