parameters: (spec1, spec2)
return_statement: return True
docstring: Indicates whether two type specifications are compatible.
  
    Two type specifications are compatible if they have the same nested structure
    and the their individual components are pair-wise compatible.
  
    Args:
      spec1: A `tf.TypeSpec` object to compare.
      spec2: A `tf.TypeSpec` object to compare.
  
    Returns:
      `True` if the two type specifications are compatible and `False` otherwise.
docstring_summary: Indicates whether two type specifications are compatible.
docstring_tokens: Indicates whether two type specifications are compatible .
function: def are_compatible(spec1, spec2):
    """Indicates whether two type specifications are compatible.
  
    Two type specifications are compatible if they have the same nested structure
    and the their individual components are pair-wise compatible.
  
    Args:
      spec1: A `tf.TypeSpec` object to compare.
      spec2: A `tf.TypeSpec` object to compare.
  
    Returns:
      `True` if the two type specifications are compatible and `False` otherwise.
    """
  
    try:
      nest.assert_same_structure(spec1, spec2)
    except TypeError:
      return False
    except ValueError:
      return False
  
    for s1, s2 in zip(nest.flatten(spec1), nest.flatten(spec2)):
      if not s1.is_compatible_with(s2) or not s2.is_compatible_with(s1):
        return False
    return True
function_tokens: def are_compatible ( spec1 , spec2 ) : try : nest . assert_same_structure ( spec1 , spec2 ) except TypeError : return False except ValueError : return False for s1 , s2 in zip ( nest . flatten ( spec1 ) , nest . flatten ( spec2 ) ) : if not s1 . is_compatible_with ( s2 ) or not s2 . is_compatible_with ( s1 ) : return False return True