code: def is_valid(
      matrix: type_alias.TensorLike,
      atol: type_alias.Float = 1e-3,
      name: str = "rotation_matrix_2d_is_valid",
  ) -> tf.Tensor:
      r"""Determines if a matrix is a valid rotation matrix.
  
      Determines if a matrix $$\mathbf{R}$$ is a valid rotation matrix by checking
      that $$\mathbf{R}^T\mathbf{R} = \mathbf{I}$$ and $$\det(\mathbf{R}) = 1$$.
  
      Note:
        In the following, A1 to An are optional batch dimensions.
  
      Args:
        matrix: A tensor of shape `[A1, ..., An, 2, 2]`, where the last two
          dimensions represent a 2d rotation matrix.
        atol: The absolute tolerance parameter.
        name: A name for this op that defaults to "rotation_matrix_2d_is_valid".
  
      Returns:
        A tensor of type `bool` and shape `[A1, ..., An, 1]` where False indicates
        that the input is not a valid rotation matrix.
      """
      with tf.name_scope(name):
          matrix = tf.convert_to_tensor(value=matrix)
  
          shape.check_static(
              tensor=matrix,
              tensor_name="matrix",
              has_rank_greater_than=1,
              has_dim_equals=((-2, 2), (-1, 2)),
          )
  
          return rotation_matrix_common.is_valid(matrix, atol)
  
file_path: graphics/tensorflow_graphics/geometry/transformation/rotation_matrix_2d.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from typing import Optional
  from six.moves import range
  import tensorflow
  from tensorflow_graphics.geometry.transformation import rotation_matrix_common
  from tensorflow_graphics.util import export_api
  from tensorflow_graphics.util import shape
  from tensorflow_graphics.util import type_alias
label_desc: Use image node_id 4 for calling a global function with example usage: is_valid(matrix, atol, name) and returns: rotation_matrix_common