input: Write a function that decodes a LibSVM input into TensorFlow tensors. The function should be named `decode_libsvm` and take the following arguments: `input` (a `Tensor` of type `string`), `num_features` (an `int` that is `>= 1`), `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`), and `name` (a name for the operation, optional). The function should return a tuple of `Tensor` objects `(label, feature_indices, feature_values, feature_shape)`.
  
  assert decode_libsvm(tf.constant(["1 1:1 2:2"]), 3, tf.float32, tf.int64, "decode") == (tf.constant(1), tf.constant([[0, 1], [0, 2]]), tf.constant([1.0, 2.0]), tf.constant([3]))
  assert decode_libsvm(tf.constant(["2 1:1 3:3"]), 3, tf.float32, tf.int32, "decode") == (tf.constant(2), tf.constant([[0, 1], [0, 3]]), tf.constant([1.0, 3.0]), tf.constant([3]))
  assert decode_libsvm(tf.constant([]), 5, tf.float64, tf.int64) == (tf.constant([]), tf.constant([]), tf.constant([]), tf.constant([5]))
output: 
  def decode_libsvm(input, num_features, dtype=tf.float32, label_dtype=tf.int64, name=None):
      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, value = tf.strings.split(part, ':')
              indices.append([0, tf.strings.to_number(idx, out_type=tf.int64)])
              values.append(tf.strings.to_number(value, out_type=dtype))
          return label, tf.stack(indices), tf.stack(values), tf.constant([num_features])
  
      labels, indices, values, shapes = tf.map_fn(
          _parse_line, input,
          dtype=(label_dtype, tf.int64, dtype, tf.int32),
          name=name
      )
      return labels, indices, values, shapes
  