code: def _maybe_check_valid_map_values(map_values, validate_args):
      """Validate `map_values` if `validate_args`==True."""
      assertions = []
  
      message = "Rank of map_values must be 1."
      if tensorshape_util.rank(map_values.shape) is not None:
          if tensorshape_util.rank(map_values.shape) != 1:
              raise ValueError(message)
      elif validate_args:
          assertions.append(
              assert_util.assert_rank(map_values, 1, message=message)
          )
  
      message = "Size of map_values must be greater than 0."
      if tensorshape_util.num_elements(map_values.shape) is not None:
          if tensorshape_util.num_elements(map_values.shape) == 0:
              raise ValueError(message)
      elif validate_args:
          assertions.append(
              assert_util.assert_greater(
                  tf.size(map_values), 0, message=message
              )
          )
  
      if validate_args:
          assertions.append(
              assert_util.assert_equal(
                  tf.math.is_strictly_increasing(map_values),
                  True,
                  message="map_values is not strictly increasing.",
              )
          )
  
      return assertions
  
file_path: probability/tensorflow_probability/python/bijectors/categorical_to_discrete.py
imports: import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import bijector
  from tensorflow_probability.python.internal import assert_util
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import parameter_properties
  from tensorflow_probability.python.internal import tensor_util
  from tensorflow_probability.python.internal import tensorshape_util
label_desc: Use image node_id 1 for calling a global function with example usage: _maybe_check_valid_map_values(map_values, validate_args) and returns: assertions