title: Pytorch Operation to detect NaNs
body: <p>
  Is there a Pytorch-internal procedure to detect <code>NaN</code>s in Tensors? Tensorflow has the <code>tf.is_nan</code> and the <code>tf.check_numerics</code> operations ... Does Pytorch have something similar, somewhere? I could not find something like this in the docs... </p>
  
  <p>I am looking specifically for a Pytorch internal routine, since I would like this to happen on the GPU as well as on the CPU. This excludes numpy - based solutions (like <code>np.isnan(sometensor.numpy()).any()</code>) ...</p>