code: def broadcast_shape(shape_x, shape_y):
      """Returns the broadcasted shape between `shape_x` and `shape_y`.
  
      Args:
        shape_x: A `TensorShape`
        shape_y: A `TensorShape`
  
      Returns:
        A `TensorShape` representing the broadcasted shape.
  
      Raises:
        ValueError: If the two shapes can not be broadcasted.
      """
      if shape_x.ndims is None or shape_y.ndims is None:
          return tensor_shape.unknown_shape()
      return_dims = _broadcast_shape_helper(shape_x, shape_y)
      if return_dims is None:
          raise ValueError(
              "Incompatible shapes for broadcasting. Two shapes are "
              "compatible if for each dimension pair they are either "
              "equal or one of them is 1. "
              f"Received: {shape_x} and {shape_y}."
          )
      return tensor_shape.TensorShape(return_dims)
  
imports: import itertools
  from tensorflow.python.framework import tensor_shape
label_desc: Use image node_id 3 for calling a global function with example usage: broadcast_shape(shape_x, shape_y) and returns: tensor_shape, tensor_shape