code: def register_all_shape_checker(shape_checker_function,
                                 arg_types,
                                 exclude=(),
                                 ignore_existing=False):
    
    for t1 in arg_types:
      for t2 in arg_types:
        if (t1, t2) in exclude:
          continue
        if ignore_existing and (t1, t2) in shape_checkers:
          continue
        register_shape_checker(t1, t2, shape_checker_function)
docs: Register a gradient adder for all combinations of given types.
  
    This is a convenience shorthand for calling register_add_grad when registering
    gradient adders for multiple types that can be interchanged for the purpose
    of addition.
  
    Args:
      shape_checker_function: A shape checker, see register_shape_checker.
      arg_types: List of Python type objects. The shape checker will be
        registered for all pairs of these types.
      exclude: Optional list of type tuples to exclude.
      ignore_existing: Boolean. Whether to silently skip argument pairs that were
        already registered.