code: def get_differing_dims(a, b):
      # Get the indices of dimensions where shapes of `a` and `b` differ.
      # `a` is allowed to have fewer dimensions than `b`.
      if not tensorshape_util.is_fully_defined(
          a.shape
      ) or not tensorshape_util.is_fully_defined(b.shape):
          return tf.where(
              tf.not_equal(tf.shape(a), tf.shape(b)[: tf.rank(a)])
          )[:, 0]
      a_shape = np.int32(a.shape)
      b_shape = np.int32(b.shape)
      return np.where(a_shape != b_shape[: len(a_shape)])[0]
  
imports: import collections
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import assert_util
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.internal import unnest
  from tensorflow_probability.python.math.generic import reduce_logmeanexp
  from tensorflow_probability.python.mcmc import kernel
  from tensorflow_probability.python.mcmc.internal import util
label_desc: Use image node_id 4 for calling a global function with example usage: get_differing_dims(a, b) and returns: np, tf