class_docstr: Random affine transformation of the image keeping center invariant.
  If the image is paddle Tensor, it is expected
  to have [..., H, W] shape, where ... means an arbitrary number of leading dimensions.
  
  Args:
      degrees (sequence or number): Range of degrees to select from.
          If degrees is a number instead of sequence like (min, max), the range of degrees
          will be (-degrees, +degrees). Set to 0 to deactivate rotations.
      translate (tuple, optional): tuple of maximum absolute fraction for horizontal
          and vertical translations. For example translate=(a, b), then horizontal shift
          is randomly sampled in the range -img_width * a < dx < img_width * a and vertical shift is
          randomly sampled in the range -img_height * b < dy < img_height * b. Will not translate by default.
      scale (tuple, optional): scaling factor interval, e.g (a, b), then scale is
          randomly sampled from the range a <= scale <= b. Will keep original scale by default.
      shear (sequence or number, optional): Range of degrees to select from.
          If shear is a number, a shear parallel to the x axis in the range (-shear, +shear)
          will be applied. Else if shear is a sequence of 2 values a shear parallel to the x axis in the
          range (shear[0], shear[1]) will be applied. Else if shear is a sequence of 4 values,
          a x-axis shear in (shear[0], shear[1]) and y-axis shear in (shear[2], shear[3]) will be applied.
          Will not apply shear by default.
      interpolation (InterpolationMode): Desired interpolation enum defined by
          :class:`torchvision.transforms.InterpolationMode`. Default is ``InterpolationMode.NEAREST``.
          If input is Tensor, only ``InterpolationMode.NEAREST``, ``InterpolationMode.BILINEAR`` are supported.
          For backward compatibility integer values (e.g. ``PIL.Image[.Resampling].NEAREST``) are still accepted,
          but deprecated since 0.13 and will be removed in 0.15. Please use InterpolationMode enum.
      fill (sequence or number): Pixel fill value for the area outside the transformed
          image. Default is ``0``. If given a number, the value is used for all bands respectively.
      fillcolor (sequence or number, optional):
          .. warning::
              This parameter was deprecated in ``0.12`` and will be removed in ``0.14``. Please use ``fill`` instead.
      resample (int, optional):
          .. warning::
              This parameter was deprecated in ``0.12`` and will be removed in ``0.14``. Please use ``interpolation``
              instead.
      center (sequence, optional): Optional center of rotation, (x, y). Origin is the upper left corner.
          Default is the center of the image.
  
  .. _filters: https://pillow.readthedocs.io/en/latest/handbook/concepts.html#filters
class_docstr_tok: ["Random","affine","transformation","of","the","image","keeping","center","invariant",".","If","the","image","is","paddle","Tensor",",","it","is","expected","to","have","[","...",",","H",",","W","]","shape",",","where","...","means","an","arbitrary","number","of","leading","dimensions",".","Args",":","degrees","(","sequence","or","number",")",":","Range","of","degrees","to","select","from",".","If","degrees","is","a","number","instead","of","sequence","like","(","min",",","max",")",",","the","range","of","degrees","will","be","(","-degrees",",","+degrees",")",".","Set","to","0","to","deactivate","rotations",".","translate","(","tuple",",","optional",")",":","tuple","of","maximum","absolute","fraction","for","horizontal","and","vertical","translations",".","For","example","translate=","(","a",",","b",")",",","then","horizontal","shift","is","randomly","sampled","in","the","range","-img_width","*","a","<","dx","<","img_width","*","a","and","vertical","shift","is","randomly","sampled","in","the","range","-img_height","*","b","<","dy","<","img_height","*","b",".","Will","not","translate","by","default",".","scale","(","tuple",",","optional",")",":","scaling","factor","interval",",","e.g","(","a",",","b",")",",","then","scale","is","randomly","sampled","from","the","range","a","<","=","scale","<","=","b",".","Will","keep","original","scale","by","default",".","shear","(","sequence","or","number",",","optional",")",":","Range","of","degrees","to","select","from",".","If","shear","is","a","number",",","a","shear","parallel","to","the","x","axis","in","the","range","(","-shear",",","+shear",")","will","be","applied",".","Else","if","shear","is","a","sequence","of","2","values","a","shear","parallel","to","the","x","axis","in","the","range","(","shear","[","0","]",",","shear","[","1","]",")","will","be","applied",".","Else","if","shear","is","a","sequence","of","4","values",",","a","x-axis","shear","in","(","shear","[","0","]",",","shear","[","1","]",")","and","y-axis","shear","in","(","shear","[","2","]",",","shear","[","3","]",")","will","be","applied",".","Will","not","apply","shear","by","default",".","interpolation","(","InterpolationMode",")",":","Desired","interpolation","enum","defined","by",":","class",":","`","torchvision.transforms.InterpolationMode","`",".","Default","is","``","InterpolationMode.NEAREST","``",".","If","input","is","Tensor",",","only","``","InterpolationMode.NEAREST","``",",","``","InterpolationMode.BILINEAR","``","are","supported",".","For","backward","compatibility","integer","values","(","e.g",".","``","PIL.Image","[",".Resampling","]",".NEAREST","``",")","are","still","accepted",",","but","deprecated","since","0.13","and","will","be","removed","in","0.15",".","Please","use","InterpolationMode","enum",".","fill","(","sequence","or","number",")",":","Pixel","fill","value","for","the","area","outside","the","transformed","image",".","Default","is","``","0","``",".","If","given","a","number",",","the","value","is","used","for","all","bands","respectively",".","fillcolor","(","sequence","or","number",",","optional",")",":","..","warning",":",":","This","parameter","was","deprecated","in","``","0.12","``","and","will","be","removed","in","``","0.14","``",".","Please","use","``","fill","``","instead",".","resample","(","int",",","optional",")",":","..","warning",":",":","This","parameter","was","deprecated","in","``","0.12","``","and","will","be","removed","in","``","0.14","``",".","Please","use","``","interpolation","``","instead",".","center","(","sequence",",","optional",")",":","Optional","center","of","rotation",",","(","x",",","y",")",".","Origin","is","the","upper","left","corner",".","Default","is","the","center","of","the","image",".","..","_filters",":","https",":","\/\/pillow.readthedocs.io\/en\/latest\/handbook\/concepts.html","#","filters"]
code: def __repr__(self) -> str:
      s = f"{self.__class__.__name__}(degrees={self.degrees}"
      s += (
          f", translate={self.translate}"
          if self.translate is not None
          else ""
      )
      s += f", scale={self.scale}" if self.scale is not None else ""
      s += f", shear={self.shear}" if self.shear is not None else ""
      s += (
          f", interpolation={self.interpolation.value}"
          if self.interpolation != InterpolationMode.NEAREST
          else ""
      )
      s += f", fill={self.fill}" if self.fill != 0 else ""
      s += f", center={self.center}" if self.center is not None else ""
      s += ")"
  
      return s
  
imports: import math
  import numbers
  import warnings
  from enum import Enum
  from typing import Any
  from typing import Dict
  from typing import List
  from typing import Optional
  from typing import Sequence
  from typing import Tuple
  from typing import Union
  import paddle
  import paddle.nn
  from paddle import Tensor
  from paddle.nn import functional
  from paddle.nn.functional import grid_sample
  from paddle.vision import transforms
label_desc: Use image node_id 4 for calling the RandomAffine obj's underlying member method code with example usage: obj.__repr__() and returns: s