def METHOD_NAME(tensors, signatures):
  """Check that tensors are compatible with signatures.
  Args:
    tensors: Dict of `Tensor` objects or single `Tensor` object.
    signatures: Dict of `TensorSignature` objects or single `TensorSignature`
      object.
  Returns:
    True if all tensors are compatible, False otherwise.
  """
  # Dict of Tensors as input.
  if tensors is None:
    return signatures is None
  if isinstance(tensors, dict):
    if not isinstance(signatures, dict):
      return False
    for key in signatures:
      if key not in tensors:
        return False
      if not TensorSignature(tensors[key]).is_compatible_with(signatures[key]):
        return False
    return True
  # Single tensor as input.
  if signatures is None or isinstance(signatures, dict):
    return False
  return TensorSignature(tensors).is_compatible_with(signatures)