parameters: (sp_input)
return_statement: return sp_input
docstring: Convert `sp_input` to `SparseTensor` and return it.
  
    Args:
      sp_input: `SparseTensor` or `SparseTensorValue`.
  
    Returns:
      `sp_input` converted to `SparseTensor`.
  
    Raises:
      ValueError: if `sp_input` is neither `SparseTensor` nor `SparseTensorValue`.
docstring_summary: Convert `sp_input` to `SparseTensor` and return it.
docstring_tokens: Convert sp_input to SparseTensor and return it .
function: def _convert_to_sparse_tensor(sp_input):
    """Convert `sp_input` to `SparseTensor` and return it.
  
    Args:
      sp_input: `SparseTensor` or `SparseTensorValue`.
  
    Returns:
      `sp_input` converted to `SparseTensor`.
  
    Raises:
      ValueError: if `sp_input` is neither `SparseTensor` nor `SparseTensorValue`.
    """
    if isinstance(sp_input, ops.SparseTensorValue):
      return ops.SparseTensor.from_value(sp_input)
    if not isinstance(sp_input, ops.SparseTensor):
      raise TypeError("Input must be a SparseTensor.")
    return sp_input
function_tokens: def _convert_to_sparse_tensor ( sp_input ) : if isinstance ( sp_input , ops . SparseTensorValue ) : return ops . SparseTensor . from_value ( sp_input ) if not isinstance ( sp_input , ops . SparseTensor ) : raise TypeError ( "Input must be a SparseTensor." ) return sp_input