title: Check if NaN in Tensorflow
body: <p>I would like to check a tensorflow variable and set it to zero if it is NaN.</p>
  
  <p>How can I do this? The following trick seems not to work:</p>
  
  <pre><code>if tf.is_nan(v) is True:
      v = 0.0
  </code></pre>