code: def _assert_broadcast(self, expected, shape1, shape2):
      if shape1.dims is not None and shape2.dims is not None:
          expected_np = expected.as_list()
          zeros1 = np.zeros(shape1.as_list())
          zeros2 = np.zeros(shape2.as_list())
          self.assertAllEqual(
              expected_np, np.broadcast(zeros1, zeros2).shape
          )
          self.assertAllEqual(
              expected_np, np.broadcast(zeros2, zeros1).shape
          )
          self.assertEqual(
              expected, common_shapes.broadcast_shape(shape1, shape2)
          )
          self.assertEqual(
              expected, common_shapes.broadcast_shape(shape2, shape1)
          )
      else:
          self.assertEqual(
              expected, common_shapes.broadcast_shape(shape1, shape2)
          )
          self.assertEqual(
              expected, common_shapes.broadcast_shape(shape2, shape1)
          )
  
file_path: tensorflow/tensorflow/python/framework/common_shapes_test.py
imports: import numpy
  from tensorflow.python.framework import common_shapes
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.framework import test_util
  from tensorflow.python.platform import googletest
label_desc: Use image node_id 2 for calling the CommonShapesTest obj's underlying member method code with example usage: obj._assert_broadcast(expected, shape1, shape2) without return types