code: def lu_reconstruct_assertions(lower_upper, perm, validate_args):
      """Returns list of assertions related to `lu_reconstruct` assumptions."""
      assertions = []
  
      message = "Input `lower_upper` must have at least 2 dimensions."
      if tensorshape_util.rank(lower_upper.shape) is not None:
          if tensorshape_util.rank(lower_upper.shape) < 2:
              raise ValueError(message)
      elif validate_args:
          assertions.append(
              assert_util.assert_rank_at_least(
                  lower_upper, rank=2, message=message
              )
          )
  
      message = "`rank(lower_upper)` must equal `rank(perm) + 1`"
      if (
          tensorshape_util.rank(lower_upper.shape) is not None
          and tensorshape_util.rank(perm.shape) is not None
      ):
          if (
              tensorshape_util.rank(lower_upper.shape)
              != tensorshape_util.rank(perm.shape) + 1
          ):
              raise ValueError(message)
      elif validate_args:
          assertions.append(
              assert_util.assert_rank(
                  lower_upper, rank=tf.rank(perm) + 1, message=message
              )
          )
  
      message = "`lower_upper` must be square."
      if tensorshape_util.is_fully_defined(lower_upper.shape[:-2]):
          if lower_upper.shape[-2] != lower_upper.shape[-1]:
              raise ValueError(message)
      elif validate_args:
          m, n = tf.split(
              tf.shape(lower_upper)[-2:], num_or_size_splits=2
          )
          assertions.append(
              assert_util.assert_equal(m, n, message=message)
          )
  
      return assertions
  
imports: import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import assert_util
  from tensorflow_probability.python.internal import custom_gradient
  from tensorflow_probability.python.internal import distribution_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.math import generic
label_desc: Use image node_id 10 for calling a global function with example usage: lu_reconstruct_assertions(lower_upper, perm, validate_args) and returns: assertions