code: def cast_to_float32(tensor):
      if tensor.dtype == tf.float32:
          return tensor
      if tensor.dtype == tf.string:
          return tf.strings.to_number(tensor, tf.float32)
      return tf.cast(tensor, tf.float32)
  
file_path: autokeras/autokeras/utils/data_utils.py
imports: import numpy
  import tensorflow
  from tensorflow import nest
label_desc: Use image node_id 7 for calling a global function with example usage: cast_to_float32(tensor) and returns: tf, tensor, tf