code: def inverse(
      matrix: type_alias.TensorLike,
      name: str = "rotation_matrix_2d_inverse",
  ) -> tf.Tensor:
      """Computes the inverse of a 2D rotation matrix.
  
      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.
        name: A name for this op that defaults to "rotation_matrix_2d_inverse".
  
      Returns:
        A tensor of shape `[A1, ..., An, 2, 2]`, where the last dimension represents
        a 2d rotation matrix.
  
      Raises:
        ValueError: If the shape of `matrix` is not supported.
      """
      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)),
          )
  
          ndims = matrix.shape.ndims
          perm = list(range(ndims - 2)) + [ndims - 1, ndims - 2]
          return tf.transpose(a=matrix, perm=perm)
  
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 3 for calling a global function with example usage: inverse(matrix, name) and returns: tf