title: Convert a tf.float32 to a regular python float
body: <p>This is my code:</p>
  
  <pre><code>import tensorflow as tf
  
  loss = tf.keras.losses.MeanSquaredError()
  
  a = loss(y_true=tf.constant([1.0, 2.0, 3.0]), y_pred=tf.constant([2.0, 2.0, 4.0]))
  print(a)
  
  b = tf.constant([2.0, 2.0, 4.0])[0]
  a = loss(y_true=tf.constant([1.0], dtype=tf.float32), y_pred=tf.constant([b], dtype=tf.float32)) #error occurs here
  print(a)
  </code></pre>
  
  <p>This is the error:</p>
  
  <blockquote>
    <p>Traceback (most recent call last):
      File "test.py", line 9, in 
        a = loss(y_true=tf.constant([1.0], dtype=tf.float32), y_pred=tf.constant([b], dtype=tf.float32))
      File "D:\documenten\programs\Python\3.6.2\lib\site-packages\tensorflow_core\python\framework\constant_op.py", line 227, in constant
        allow_broadcast=True)
      File "D:\documenten\programs\Python\3.6.2\lib\site-packages\tensorflow_core\python\framework\constant_op.py", line 235, in _constant_impl
        t = convert_to_eager_tensor(value, ctx, dtype)
      File "D:\documenten\programs\Python\3.6.2\lib\site-packages\tensorflow_core\python\framework\constant_op.py", line 96, in convert_to_eager_tensor
        return ops.EagerTensor(value, ctx.device_name, dtype)
    ValueError: TypeError: Scalar tensor has no <code>len()</code></p>
  </blockquote>
  
  <p>In this exemple I can't use 'b' to put in an other tensor, but the regular float works just fine.
  Is there a method change a tf.float32 to a regular python float?</p>