code: def broadcast_shape(x_shape, y_shape):
      """Computes the shape of a broadcast.
  
      When both arguments are statically-known, the broadcasted shape will be
      computed statically and returned as a `TensorShape`.  Otherwise, a rank-1
      `Tensor` will be returned.
  
      Args:
        x_shape: A `TensorShape` or rank-1 integer `Tensor`.  The input `Tensor` is
          broadcast against this shape.
        y_shape: A `TensorShape` or rank-1 integer `Tensor`.  The input `Tensor` is
          broadcast against this shape.
  
      Returns:
        shape: A `TensorShape` or rank-1 integer `Tensor` representing the
          broadcasted shape.
      """
      x_shape_static = tf.get_static_value(x_shape)
      y_shape_static = tf.get_static_value(y_shape)
      if (x_shape_static is None) or (y_shape_static is None):
          return tf.broadcast_dynamic_shape(x_shape, y_shape)
  
      return tf.broadcast_static_shape(
          tf.TensorShape(x_shape_static), tf.TensorShape(y_shape_static)
      )
  
imports: import decorator
  import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.internal.backend import numpy
  from tensorflow.python.framework import tensor_util
  from tensorflow.python.ops import control_flow_case
  from tensorflow.python.util import tf_inspect
label_desc: Use image node_id 10 for calling a global function with example usage: broadcast_shape(x_shape, y_shape) and returns: tf, tf