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.
  
      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).
  
      >>> decode_libsvm(tf.constant(['1 2:3', '4 5:6']), 2, tf.float32, tf.int64).numpy().tolist()
      (array([1, 4], dtype=int64), array([[0, 1], [1, 0], [1, 1]], dtype=int64), array([3., 4., 6.], dtype=float32), array([2, 2], dtype=int64))
      """
output:     
      with tf.name_scope(name, "decode_libsvm", [input]) as scope:
          input = tf.convert_to_tensor(input, name="input")
          
          # Split the input strings into labels and feature strings
          splits = tf.strings.split(input, sep=' ')
          labels = tf.strings.to_number(splits.values[0::2], out_type=label_dtype)
          feature_strings = splits.values[1::2]
          
          # Split the feature strings into indices and values
          feature_splits = tf.strings.split(feature_strings, sep=':')
          feature_indices = tf.strings.to_number(feature_splits.values[0::2], out_type=tf.int64)
          feature_values = tf.strings.to_number(feature_splits.values[1::2], out_type=dtype)
          
          # Reshape the feature indices and values to match the expected output format
          feature_indices = tf.reshape(feature_indices, [-1, 1])
          feature_values = tf.reshape(feature_values, [-1])
          
          # Create a dense shape for the features
          feature_shape = tf.constant([tf.shape(input)[0], num_features], dtype=tf.int64)
          
          return labels, feature_indices, feature_values, feature_shape
  