code: def assert_all_in_range(
      vector: type_alias.TensorLike,
      minval: type_alias.TensorLike,
      maxval: type_alias.TensorLike,
      open_bounds: bool = False,
      name: str = "assert_all_in_range",
  ) -> tf.Tensor:
      """Checks whether all values of vector are between minval and maxval.
  
      This function checks if all the values in the given vector are in an interval
      `[minval, maxval]` if `open_bounds` is `False`, or in `]minval, maxval[` if it
      is set to `True`.
  
      Note:
        In the following, A1 to An are optional batch dimensions.
  
      Args:
        vector: A tensor of shape `[A1, ..., An]` containing the values we want to
          check.
        minval: A `float` or a tensor of shape `[A1, ..., An]` representing the
          desired lower bound for the values in `vector`.
        maxval: A `float` or a tensor of shape `[A1, ..., An]` representing the
          desired upper bound for the values in `vector`.
        open_bounds: A `bool` indicating whether the range is open or closed.
        name: A name for this op. Defaults to 'assert_all_in_range'.
  
      Raises:
        tf.errors.InvalidArgumentError: If `vector` is not in the expected range.
  
      Returns:
        The input vector, with dependence on the assertion operator in the graph.
      """
      if not FLAGS[tfg_flags.TFG_ADD_ASSERTS_TO_GRAPH].value:
          return vector
  
      with tf.name_scope(name):
          vector = tf.convert_to_tensor(value=vector)
          minval = tf.convert_to_tensor(
              value=minval, dtype=vector.dtype
          )
          maxval = tf.convert_to_tensor(
              value=maxval, dtype=vector.dtype
          )
  
          if open_bounds:
              assert_ops = (
                  tf.debugging.assert_less(vector, maxval),
                  tf.debugging.assert_greater(vector, minval),
              )
          else:
              assert_ops = (
                  tf.debugging.assert_less_equal(vector, maxval),
                  tf.debugging.assert_greater_equal(vector, minval),
              )
          with tf.control_dependencies(assert_ops):
              return tf.identity(vector)
  
file_path: graphics/tensorflow_graphics/util/asserts.py
imports: from typing import Optional
  from absl import flags
  import numpy
  import tensorflow
  from tensorflow_graphics.util import tfg_flags
  from tensorflow_graphics.util import type_alias
label_desc: Use image node_id 4 for calling a global function with example usage: assert_all_in_range(vector, minval, maxval, open_bounds, name) and returns: vector, tf