input: def decode_libsvm(input: Tensor, num_features: int, dtype: tf.DType = tf.float32, label_dtype: tf.DType = tf.int64, name: Optional[str] = None) -> Tuple[Tensor, Tensor, Tensor, 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]`.
  
      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].
  
      >>> decode_libsvm(tf.constant(["1 2:1.0 3:2.0", "3 1:3.0"]), 3)
      (<tf.Tensor: shape=(2,), dtype=int64, numpy=array([1, 3], dtype=int64)>, <tf.Tensor: shape=(4, 2), dtype=int64, numpy=array([[0, 2], [0, 3], [1, 1], [1, 3]], dtype=int64)>, <tf.Tensor: shape=(4,), dtype=float32, numpy=array([1., 2., 3., 1.], dtype=float32)>, <tf.Tensor: shape=(2,), dtype=int64, numpy=array([2, 4], dtype=int64)>)
      >>> decode_libsvm(tf.constant(["1 2:1.0 3:2.0", "3 1:3.0"]), 3, dtype=tf.float64)
      (<tf.Tensor: shape=(2,), dtype=int64, numpy=array([1, 3], dtype=int64)>, <tf.Tensor: shape=(4, 2), dtype=int64, numpy=array([[0, 2], [0, 3], [1, 1], [1, 3]], dtype=int64)>, <tf.Tensor: shape=(4,), dtype=float64, numpy=array([1., 2., 3., 1.], dtype=float64)>, <tf.Tensor: shape=(2,), dtype=int64, numpy=array([2, 4], dtype=int64)>)
      """
output:     with tf.name_scope(name, "decode_libsvm", [input, num_features, dtype, label_dtype]):
          def parse_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_list, values_list = tf.map_fn(
              parse_line,
              input,
              dtype=(label_dtype, tf.int64, dtype),
              back_prop=False
          )
  
          indices_flat = tf.reshape(indices_list, [-1])
          values_flat = tf.reshape(values_list, [-1])
          row_lengths = tf.map_fn(lambda x: tf.size(x), indices_list, dtype=tf.int64)
          row_indices = tf.repeat(tf.range(tf.shape(row_lengths)[0], dtype=tf.int64), row_lengths)
          feature_indices = tf.stack([row_indices, indices_flat], axis=1)
  
          feature_shape = tf.shape(input, out_type=tf.int64)
          feature_shape = tf.concat([feature_shape, [num_features]], axis=0)
  
          return labels, feature_indices, values_flat, feature_shape