code: def to_feature(value):
    
    if isinstance(value, FeatureConnector):
      return value
    elif utils.is_dtype(value):  # tf.int32, tf.string,...
      return Tensor(shape=(), dtype=tf.as_dtype(value))
    elif isinstance(value, dict):
      return FeaturesDict(value)
    else:
      raise ValueError('Feature not supported: {}'.format(value))
docs: Convert the given value to Feature if necessary.