input: Write a python function to convert LibSVM input to tensors.
  assert decode_libsvm(["1 1:0.5 2:1.5", "-1 1:1.0 2:0.5"], 3) == (_tf.constant([1, -1], dtype=_dtypes.int64), _tf.constant([[0, 1], [0, 2], [1, 1], [1, 2]], dtype=_dtypes.int64), _tf.constant([0.5, 1.5, 1.0, 0.5], dtype=_dtypes.float32), _tf.constant([2, 3], dtype=_dtypes.int64))
  assert decode_libsvm(["1 1:0.5 2:1.5"], 2) == (_tf.constant([1], dtype=_dtypes.int64), _tf.constant([[0, 1], [0, 2]], dtype=_dtypes.int64), _tf.constant([0.5, 1.5], dtype=_dtypes.float32), _tf.constant([1, 2], dtype=_dtypes.int64))
  assert decode_libsvm(["-1 1:1.0"], 1) == (_tf.constant([-1], dtype=_dtypes.int64), _tf.constant([[0, 1]], dtype=_dtypes.int64), _tf.constant([1.0], dtype=_dtypes.float32), _tf.constant([1, 1], dtype=_dtypes.int64))
output: def decode_libsvm(lines, num_features):
      import tensorflow as tf
      from tensorflow.python.framework import dtypes as _dtypes
  
      labels = []
      indices = []
      values = []
      example_ids = []
  
      for i, line in enumerate(lines):
          parts = line.split()
          label = int(parts[0])
          labels.append(label)
          for feature in parts[1:]:
              index, value = feature.split(":")
              indices.append([i, int(index)])
              values.append(float(value))
          example_ids.append(i + 1)
  
      labels_tensor = tf.constant(labels, dtype=_dtypes.int64)
      indices_tensor = tf.constant(indices, dtype=_dtypes.int64)
      values_tensor = tf.constant(values, dtype=_dtypes.float32)
      example_ids_tensor = tf.constant(example_ids, dtype=_dtypes.int64)
  
      return labels_tensor, indices_tensor, values_tensor, example_ids_tensor