code: def _maybe_validate_input_shapes(
      kernel_shape,
      channels_in,
      filter_height,
      filter_width,
      validate_args,
  ):
      """Validate shapes of inputs to convolution op."""
      k_dim = kernel_shape[-2]
      k_dim_ = tf.get_static_value(k_dim)
      expected_k_dim = filter_height * filter_width * channels_in
      expected_k_dim_ = tf.get_static_value(expected_k_dim)
      assertions = []
      if expected_k_dim_ is not None and k_dim_ is not None:
          if expected_k_dim_ != k_dim_:
              raise ValueError(
                  "The size of the second-to-rightmost dimension of `kernel` ( ={}) "
                  " must equal `filter_height * filter_width * channels_in` ( ={}), "
                  "where `channels_in` is the size of the rightmost dimension of the "
                  "input.".format(k_dim_, expected_k_dim_)
              )
      elif validate_args:
          assertions.append(
              assert_util.assert_equal(
                  k_dim,
                  expected_k_dim,
                  message=(
                      "The size of the second-to-rightmost dimension of `kernel`"
                      " must equal `filter_height * filter_width * channels_in`,"
                      " where `channels_in` is the size of the rightmost "
                      "dimension of the input."
                  ),
              )
          )
      return assertions
  
imports: import tensorflow.compat.v2
  from tensorflow_probability.python.experimental.nn.util import utils
  from tensorflow_probability.python.internal import assert_util
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
label_desc: Use image node_id 10 for calling a global function with example usage: _maybe_validate_input_shapes(kernel_shape, channels_in, filter_height, filter_width, validate_args) and returns: assertions