title: How to cast int32 tensor to float32
body: <p>How can I cast an <code>int32</code> tensor to <code>float32</code> in tensorflow. I don't understand what <code>tf.cast</code> does. It does not seem to do anything.</p>
  
  <pre><code>import tensorflow as tf
  import numpy as np
  
  tf.enable_eager_execution()
  
  a = tf.constant([[1, 2, 3, 4], [1, 2, 3, 4]])
  b = tf.cast(a, dtype=tf.float32)
  
  print(tf.shape(a))
  print(tf.shape(b))
  </code></pre>
  
  <p>outputs;</p>
  
  <pre><code>tf.Tensor([2 4], shape=(2,), dtype=int32) #a   
  tf.Tensor([2 4], shape=(2,), dtype=int32) #b
  </code></pre>