code: def assert_tf_shape_match(
      shape1: tf.TensorShape, shape2: tf.TensorShape
  ) -> None:
      if shape1.rank is None or shape2.rank is None:
          raise ValueError(
              "Shapes must have known rank. Got %s and %s."
              % (shape1.rank, shape2.rank)
          )
      shape1.assert_same_rank(shape2)
      shape1.assert_is_compatible_with(shape2)
  
imports: from __future__ import annotations
  import collections
  import contextlib
  from typing import Any, Union
  import numpy
  from tensorflow_datasets.core.utils import py_utils
  from tensorflow_datasets.core.utils import tree_utils
  from tensorflow_datasets.core.utils import type_utils
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
label_desc: Use image node_id 3 for calling a global function with example usage: assert_tf_shape_match(shape1, shape2) without return types