def _is_ragged_tensor(t) -> bool:
  """Returns true if the value is a RaggedTensor *or* a normal tensor."""
  if isinstance(t, tf.RaggedTensor):
    return True
  if _is_tensor(t):
    return True
  return False
Returns true if the value is a RaggedTensor *or* a normal tensor.
language/canine/tensor_contracts.py