code: def asfloat(value):
      """
      Convert variable to 32 bit float number.
  
      Parameters
      ----------
      value : matrix, ndarray, Tensorfow variable or scalar
          Value that could be converted to float type.
  
      Returns
      -------
      matrix, ndarray, Tensorfow variable or scalar
          Output would be input value converted to 32 bit float.
      """
      float_type = "float32"
  
      if isinstance(value, (np.matrix, np.ndarray)):
          if value.dtype != np.dtype(float_type):
              return value.astype(float_type)
  
          return value
  
      elif isinstance(value, (tf.Tensor, tf.SparseTensor)):
          return tf.cast(value, tf.float32)
  
      elif issparse(value):
          return value
  
      float_x_type = np.cast[float_type]
      return float_x_type(value)
  
imports: import numpy
  import tensorflow
  from scipy.sparse import issparse
label_desc: Use image node_id 2 for calling a global function with example usage: asfloat(value) and returns: float_x_type, value, value, tf, value