input: 
  def decode_libsvm(input: tf.Tensor, num_features: int, dtype: tf.DType = tf.float32, label_dtype: tf.DType = tf.int64, name: str = None) -> Tuple[tf.Tensor, tf.Tensor, tf.Tensor, tf.Tensor]:
      """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].
      >>> decode_libsvm(tf.constant(["1 2:1 3:1"]), 3, tf.float32, tf.int64)
      (<tf.Tensor: shape=(1,), dtype=int64, numpy=array([1], dtype=int64)>, <tf.Tensor: shape=(2, 2), dtype=int64, numpy=array([[0, 1], [0, 2]], dtype=int64)>, <tf.Tensor: shape=(2,), dtype=float32, numpy=array([1., 1.], dtype=float32)>, <tf.Tensor: shape=(2,), dtype=int64, numpy=array([2, 3], dtype=int64)>)
      """
  
output:     
      with tf.name_scope(name or "decode_libsvm"):
          def parse_line(line):
              parts = tf.strings.split(line, ' ')
              label = tf.strings.to_number(parts[0], label_dtype)
              indices = []
              values = []
              for part in parts[1:]:
                  feature_parts = tf.strings.split(part, ':')
                  index = tf.strings.to_number(feature_parts[0], tf.int64)
                  value = tf.strings.to_number(feature_parts[1], dtype)
                  indices.append([0, index - 1])
                  values.append(value)
              return label, tf.constant(indices, dtype=tf.int64), tf.constant(values, dtype=dtype), tf.constant([index for _, index in indices], dtype=tf.int64)
  
          labels, indices, values, feature_indices = tf.map_fn(
              parse_line, input, dtype=(label_dtype, tf.int64, dtype, tf.int64),
              infer_shape=False, name="map_parse_line"
          )
  
          return labels, indices, values, feature_indices
  