class_docstr: Rotate the tensor anti-clockwise about the centre.
  
  Args:
      angle: The angle through which to rotate. The tensor
        must have a shape of (B), where B is batch size.
      center: The center through which to rotate. The tensor
        must have a shape of (B, 2), where B is batch size and last
        dimension contains cx and cy.
      mode: interpolation mode to calculate output values
        ``'bilinear'`` | ``'nearest'``.
      padding_mode: padding mode for outside grid values
        ``'zeros'`` | ``'border'`` | ``'reflection'``.
      align_corners: interpolation flag.
  
  Returns:
      The rotated tensor with the same shape as the input.
  
  Example:
      >>> img = torch.rand(1, 3, 4, 4)
      >>> angle = torch.tensor([90.])
      >>> out = Rotate(angle)(img)
      >>> print(out.shape)
      torch.Size([1, 3, 4, 4])
class_docstr_tok: ["Rotate","the","tensor","anti-clockwise","about","the","centre",".","Args",":","angle",":","The","angle","through","which","to","rotate",".","The","tensor","must","have","a","shape","of","(","B",")",",","where","B","is","batch","size",".","center",":","The","center","through","which","to","rotate",".","The","tensor","must","have","a","shape","of","(","B",",","2",")",",","where","B","is","batch","size","and","last","dimension","contains","cx","and","cy",".","mode",":","interpolation","mode","to","calculate","output","values","``","'bilinear","'","``","|","``","'nearest","'","``",".","padding_mode",":","padding","mode","for","outside","grid","values","``","'zeros","'","``","|","``","'border","'","``","|","``","'reflection","'","``",".","align_corners",":","interpolation","flag",".","Returns",":","The","rotated","tensor","with","the","same","shape","as","the","input",".","Example",":",">",">",">","img","=","torch.rand","(","1",",","3",",","4",",","4",")",">",">",">","angle","=","torch.tensor","(","[","90",".","]",")",">",">",">","out","=","Rotate","(","angle",")","(","img",")",">",">",">","print","(","out.shape",")","torch.Size","(","[","1",",","3",",","4",",","4","]",")"]
code: def __init__(
      self,
      angle: torch.Tensor,
      center: Union[None, torch.Tensor] = None,
      mode: str = "bilinear",
      padding_mode: str = "zeros",
      align_corners: bool = True,
  ) -> None:
      super().__init__()
      self.angle: torch.Tensor = angle
      self.center: Union[None, torch.Tensor] = center
      self.mode: str = mode
      self.padding_mode: str = padding_mode
      self.align_corners: bool = align_corners
  
imports: from typing import Optional, Tuple, Union
  import torch
  from torch import nn
  from kornia.core import ones, ones_like, zeros
  from kornia.filters import gaussian_blur2d
  from kornia.utils import _extract_device_dtype
  from kornia.utils.image import perform_keep_shape_image
  from kornia.utils.misc import eye_like
  from .imgwarp import get_affine_matrix2d, get_projective_transform, get_rotation_matrix2d, warp_affine, warp_affine3d
label_desc: Use image node_id 1 to create a new Rotate object from inherited base classes: nn with example: obj = Rotate(angle, center, mode, padding_mode, align_corners)