input: 
  def decode_libsvm(input, num_features, dtype=_dtypes.float32, label_dtype=_dtypes.int64, name=None):
      """Convert LibSVM input to tensors. The output consists of
  
      a label and a feature tensor. The shape of the label tensor
      is the same as input and the shape of the feature tensor is
      `[input_shape, num_features]`.
  
      Args:
          input: A `Tensor` of type `string`. Each string is a record in the LibSVM.
          num_features: An `int` that is `>= 1`. The number of features.
          dtype: An optional `tf.DType` from: `tf.float32, tf.float64, tf.int32, tf.int64`. Defaults to `tf.float32`.
          label_dtype: An optional `tf.DType` from: `tf.float32, tf.float64, tf.int32, tf.int64`. Defaults to `tf.int64`.
          name: A name for the operation (optional).
  
      Returns:
          A tuple of `Tensor` objects (label, feature_indices, feature_values, feature_shape).
  
          label: A `Tensor` of type `label_dtype`. A tensor of the same shape as input.
          feature_indices: A `Tensor` of type `int64`. A 2-D int64 tensor of dense_shape [N, ndims].
          feature_values: A `Tensor` of type `dtype`. A 1-D tensor of any type and dense_shape [N].
          feature_shape: A `Tensor` of type `int64`. A 1-D int64 tensor of dense_shape [ndims].
      
      >>> import tensorflow as tf
      >>> from tensorflow.python.framework import ops as _ops
      >>> _ops.RegisterShape("DecodeLibsvm")(None)
      >>> def test_decode_libsvm():
      ...     input_data = tf.constant(["1 1:1 2:2", "2 1:3 2:4"])
      ...     result = decode_libsvm(input_data, 3, dtype=tf.float32, label_dtype=tf.int32)
      ...     with tf.Session() as sess:
      ...         print(sess.run([result]))
      ...         # Expected Output:
      ...         # (array([1, 2], dtype=int32), 
      ...         #  array([[0, 1], [0, 2], [1, 1], [1, 2]], dtype=int64), 
      ...         #  array([1., 2., 3., 4.], dtype=float32), 
      ...         #  array([2, 3], dtype=int64))
      >>> test_decode_libsvm()
      """
  
output:     
      with ops.name_scope(name, "decode_libsvm", [input]) as name:
          input = ops.convert_to_tensor(input, name="input")
          num_features = ops.convert_to_tensor(num_features, dtype=dtypes.int32, name="num_features")
          
          def _parse_libsvm(line):
              tokens = tf.string_split([line], " ").values
              label = tf.string_to_number(tokens[0], out_type=label_dtype)
              indices = []
              values = []
              for token in tokens[1:]:
                  feature_index, feature_value = tf.string_split([token], ":").values
                  indices.append([tf.string_to_number(feature_index, out_type=dtypes.int64)])
                  values.append(tf.string_to_number(feature_value, out_type=dtype))
              indices = tf.concat(indices, axis=0)
              values = tf.stack(values)
              return label, indices, values
          
          labels, indices, values = tf.map_fn(_parse_libsvm, input, dtype=(label_dtype, dtypes.int64, dtype), back_prop=False)
          
          feature_shape = tf.stack([tf.shape(input)[0], num_features])
          
          return labels, indices, values, feature_shape
  