code: def assert_normalized(
      vector: type_alias.TensorLike,
      order: str = "euclidean",
      axis: int = -1,
      eps: Optional[type_alias.Float] = None,
      name: str = "assert_normalized",
  ) -> tf.Tensor:
      """Checks whether vector/quaternion is normalized in its last dimension.
  
      Note:
        In the following, A1 to An are optional batch dimensions.
  
      Args:
        vector: A tensor of shape `[A1, ..., M, ..., An]`, where the axis of M
          contains the vectors.
        order: Order of the norm passed to tf.norm.
        axis: The axis containing the vectors.
        eps: A `float` describing the tolerance used to determine if the norm is
          equal to `1.0`.
        name: A name for this op. Defaults to 'assert_normalized'.
  
      Raises:
        InvalidArgumentError: If the norm of `vector` is not `1.0`.
  
      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)
          if eps is None:
              eps = select_eps_for_division(vector.dtype)
          eps = tf.convert_to_tensor(value=eps, dtype=vector.dtype)
  
          norm = tf.norm(tensor=vector, ord=order, axis=axis)
          one = tf.constant(1.0, dtype=norm.dtype)
          with tf.control_dependencies(
              [tf.debugging.assert_near(norm, one, atol=eps)]
          ):
              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 6 for calling a global function with example usage: assert_normalized(vector, order, axis, eps, name) and returns: vector, tf