code: def sg_float(tensor, opt):
      r
      return tf.cast(tensor, tf.sg_floatx, name=opt.name)
docs: r"""Casts a tensor to floatx.
      
      See `tf.cast()` in tensorflow.
  
      Args:
        tensor: A `Tensor` or `SparseTensor` (automatically given by chain).
        opt:
          name : If provided, it replaces current tensor's name
  
      Returns:
        A `Tensor` or `SparseTensor` with same shape as `tensor`.