class_docstr: Apply a random rotation to a tensor image or a batch of tensor images given an amount of degrees.
  
  .. image:: _static/img/RandomRotation.png
  
  Args:
      degrees: range of degrees to select from. If degrees is a number the
        range of degrees to select from will be (-degrees, +degrees).
      resample: Default: the interpolation mode.
      same_on_batch: apply the same transformation across the batch.
      align_corners: interpolation flag.
      p: probability of applying the transformation.
      keepdim: whether to keep the output shape the same as input (True) or broadcast it
               to the batch form (False).
  
  Shape:
      - Input: :math:`(C, H, W)` or :math:`(B, C, H, W)`, Optional: :math:`(B, 3, 3)`
      - Output: :math:`(B, C, H, W)`
  
  .. note::
      This function internally uses :func:`kornia.geometry.transform.affine`.
  
  Examples:
      >>> rng = torch.manual_seed(0)
      >>> input = torch.tensor([[1., 0., 0., 2.],
      ...                       [0., 0., 0., 0.],
      ...                       [0., 1., 2., 0.],
      ...                       [0., 0., 1., 2.]])
      >>> aug = RandomRotation(degrees=45.0, p=1.)
      >>> out = aug(input)
      >>> out
      tensor([[[[0.9824, 0.0088, 0.0000, 1.9649],
                [0.0000, 0.0029, 0.0000, 0.0176],
                [0.0029, 1.0000, 1.9883, 0.0000],
                [0.0000, 0.0088, 1.0117, 1.9649]]]])
      >>> aug.transform_matrix
      tensor([[[ 1.0000, -0.0059,  0.0088],
               [ 0.0059,  1.0000, -0.0088],
               [ 0.0000,  0.0000,  1.0000]]])
      >>> inv = aug.inverse(out)
  
  To apply the exact augmenation again, you may take the advantage of the previous parameter state:
      >>> input = torch.randn(1, 3, 32, 32)
      >>> aug = RandomRotation(degrees=45.0, p=1.)
      >>> (aug(input) == aug(input, params=aug._params)).all()
      tensor(True)
class_docstr_tok: ["Apply","a","random","rotation","to","a","tensor","image","or","a","batch","of","tensor","images","given","an","amount","of","degrees",".","..","image",":",":","_static\/img\/RandomRotation.png","Args",":","degrees",":","range","of","degrees","to","select","from",".","If","degrees","is","a","number","the","range","of","degrees","to","select","from","will","be","(","-degrees",",","+degrees",")",".","resample",":","Default",":","the","interpolation","mode",".","same_on_batch",":","apply","the","same","transformation","across","the","batch",".","align_corners",":","interpolation","flag",".","p",":","probability","of","applying","the","transformation",".","keepdim",":","whether","to","keep","the","output","shape","the","same","as","input","(","True",")","or","broadcast","it","to","the","batch","form","(","False",")",".","Shape",":","-","Input",":",":","math",":","`","(","C",",","H",",","W",")","`","or",":","math",":","`","(","B",",","C",",","H",",","W",")","`",",","Optional",":",":","math",":","`","(","B",",","3",",","3",")","`","-","Output",":",":","math",":","`","(","B",",","C",",","H",",","W",")","`","..","note",":",":","This","function","internally","uses",":","func",":","`","kornia.geometry.transform.affine","`",".","Examples",":",">",">",">","rng","=","torch.manual_seed","(","0",")",">",">",">","input","=","torch.tensor","(","[","[","1.",",","0.",",","0.",",","2",".","]",",","...","[","0.",",","0.",",","0.",",","0",".","]",",","...","[","0.",",","1.",",","2.",",","0",".","]",",","...","[","0.",",","0.",",","1.",",","2",".","]","]",")",">",">",">","aug","=","RandomRotation","(","degrees=45.0",",","p=1",".",")",">",">",">","out","=","aug","(","input",")",">",">",">","out","tensor","(","[","[","[","[","0.9824",",","0.0088",",","0.0000",",","1.9649","]",",","[","0.0000",",","0.0029",",","0.0000",",","0.0176","]",",","[","0.0029",",","1.0000",",","1.9883",",","0.0000","]",",","[","0.0000",",","0.0088",",","1.0117",",","1.9649","]","]","]","]",")",">",">",">","aug.transform_matrix","tensor","(","[","[","[","1.0000",",","-0.0059",",","0.0088","]",",","[","0.0059",",","1.0000",",","-0.0088","]",",","[","0.0000",",","0.0000",",","1.0000","]","]","]",")",">",">",">","inv","=","aug.inverse","(","out",")","To","apply","the","exact","augmenation","again",",","you","may","take","the","advantage","of","the","previous","parameter","state",":",">",">",">","input","=","torch.randn","(","1",",","3",",","32",",","32",")",">",">",">","aug","=","RandomRotation","(","degrees=45.0",",","p=1",".",")",">",">",">","(","aug","(","input",")","==","aug","(","input",",","params=aug._params",")",")",".all","(",")","tensor","(","True",")"]
code: def inverse_transform(
      self,
      input: Tensor,
      flags: Dict[str, Any],
      transform: Optional[Tensor] = None,
      size: Optional[Tuple[int, int]] = None,
  ) -> Tensor:
      if not isinstance(transform, Tensor):
          raise TypeError(
              f"Expected the `transform` be a Tensor. Got {type(transform)}."
          )
      return self.apply_transform(
          input,
          params=self._params,
          transform=as_tensor(
              transform, device=input.device, dtype=input.dtype
          ),
          flags=flags,
      )
  
file_path: kornia/kornia/augmentation/_2d/geometric/rotation.py
imports: from typing import Any, Dict, List, Optional, Tuple, Union
  from kornia.augmentation import random_generator
  from kornia.augmentation._2d.geometric.base import GeometricAugmentationBase2D
  from kornia.constants import Resample
  from kornia.core import Tensor, as_tensor
  from kornia.geometry.transform import affine
  from kornia.geometry.transform.affwarp import _compute_rotation_matrix, _compute_tensor_center
  from kornia.utils.misc import eye_like
label_desc: Use image node_id 4 for calling the RandomRotation obj's underlying member method code with example usage: obj.inverse_transform(input, flags, transform, size) and returns: self