input: from typing import List, Tuple
  import tensorflow as tf
  
  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 1:2.3 2:4.5", "3 1:3.3 2:5.6"]), 2, tf.float32, tf.int64)
      (Tensor("label:0", shape=(2,), dtype=int64), Tensor("feature_indices:0", shape=(4, 2), dtype=int64), Tensor("feature_values:0", shape=(4,), dtype=float32), Tensor("feature_shape:0", shape=(2,), dtype=int64))
      >>> decode_libsvm(tf.constant(["-1 3:1.1 1:3.4"]), 3, tf.float64, tf.int32)
      (Tensor("label:0", shape=(1,), dtype=int32), Tensor("feature_indices:0", shape=(2, 2), dtype=int64), Tensor("feature_values:0", shape=(2,), dtype=float64), Tensor("feature_shape:0", shape=(2,), dtype=int64))
      """
  
output:     
      with tf.name_scope(name, "decode_libsvm", [input]):
          def split_line(line):
              parts = tf.strings.split(line, " ")
              label = tf.strings.to_number(parts[0], out_type=label_dtype)
              indices = []
              values = []
              for part in parts[1:]:
                  idx, val = tf.strings.split(part, ":")
                  indices.append([tf.strings.to_number(idx, out_type=tf.int64)])
                  values.append(tf.strings.to_number(val, out_type=dtype))
              return label, indices, values
  
          labels, indices, values = tf.map_fn(
              split_line, input, dtype=(label_dtype, tf.int64, dtype),
              back_prop=False, name="map_fn"
          )
  
          indices = tf.concat(indices, axis=0)
          values = tf.concat(values, axis=0)
          shape = tf.stack([tf.shape(input)[0], num_features])
  
          return labels, indices, values, shape
  