<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _is_sparse(x):
 """Returns whether x is a SparseTensor or a parsed sparse tensor info."""

  return (
      isinstance(x, (tf.SparseTensor, tf_v1.SparseTensorValue)) or
      (hasattr(x, "is_sparse") and x.is_sparse))