title: Tensorflow Value for attr 'TI' of float is not in the list of allowed values when One Hot Encoding
body: <p>I have this code that takes a tensor with a shape of <code>(3, 3)</code> and reshapes it to  <code>(9,)</code>. After that it applies a <code>one_hot</code> function but it throws an error.</p>
  <p>This is the code:</p>
  <pre><code>import tensorflow as tf
  
  t1 = tf.constant([[1, 0, 0], [0, 1, 0], [0, 0, 1]], dtype=tf.float32)
  t2 = tf.constant([[1], [-1], [1]], dtype=tf.float32)
  
  print(tf.one_hot(tf.reshape(t1, -1), depth=2))
  </code></pre>
  <p>And the error is :</p>
  <pre><code>InvalidArgumentError: Value for attr 'TI' of float is not in the list of allowed values: uint8, int32, int64
      ; NodeDef: {{node OneHot}}; Op&lt;name=OneHot; signature=indices:TI, depth:int32, on_value:T, off_value:T -&gt; output:T; attr=axis:int,default=-1; attr=T:type; attr=TI:type,default=DT_INT64,allowed=[DT_UINT8, DT_INT32, DT_INT64]&gt; [Op:OneHot]
  </code></pre>
  <p>I'm working in a GoogleColab notebook, so I think that the problem might be the version of TensorFlow or the data types of the tensor, but any other solutions would be appreciated.</p>