input: 
  @tf_export('decode_libsvm')
  def decode_libsvm(input, num_features, dtype=_dtypes.float32, label_dtype=_dtypes.int64, name=None):
      r"""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].
      
      Example:
      >>> decode_libsvm(["1 2:0.4 4:0.9", "2 3:0.3"], 4)
      (_tf.Tensor([1, 2], shape=(2,), dtype=int64), _tf.Tensor([[0, 2], [0, 4]], shape=(2, 2), dtype=int64), _tf.Tensor([0.4, 0.9], shape=(2,), dtype=float32), _tf.Tensor([2, 4], shape=(2,), dtype=int64))
      """
  
output:     with ops.name_scope(name, "decode_libsvm", [input]) as name:
          input = ops.convert_to_tensor(input, name="input")
          input_shape = array_ops.shape(input)
          input_rank = array_ops.rank(input)
  
          def _parse_line(line):
              parts = _regex_replace(line).split()
              label = parts[0]
              indices = []
              values = []
              for part in parts[1:]:
                  index, value = part.split(":")
                  indices.append(int(index))
                  values.append(dtype.as_numpy_dtype(value))
              return label, indices, values
  
          def _regex_replace(line):
              return re.sub(r'\s+', ' ', line.strip())
  
          labels, indices, values = map(list, zip(*map(_parse_line, input.numpy())))
  
          labels = ops.convert_to_tensor(labels, dtype=label_dtype, name="labels")
          indices = ops.convert_to_tensor(indices, dtype=_dtypes.int64, name="feature_indices")
          values = ops.convert_to_tensor(values, dtype=dtype, name="feature_values")
          shape = ops.convert_to_tensor([input_shape[0], num_features], dtype=_dtypes.int64, name="feature_shape")
  
          return labels, indices, values, shape