(self, img)
return F.affine(img, *ret, interpolation=self.interpolation, fill=fill)
img (PIL Image or Tensor): Image to be transformed.

        Returns:
            PIL Image or Tensor: Affine transformed image.
img (PIL Image or Tensor): Image to be transformed.
img ( PIL Image or Tensor ) : Image to be transformed .
def forward(self, img):
        """
            img (PIL Image or Tensor): Image to be transformed.

        Returns:
            PIL Image or Tensor: Affine transformed image.
        """
        fill = self.fill
        if isinstance(img, Tensor):
            if isinstance(fill, (int, float)):
                fill = [float(fill)] * F._get_image_num_channels(img)
            else:
                fill = [float(f) for f in fill]

        img_size = F._get_image_size(img)

        ret = self.get_params(self.degrees, self.translate, self.scale,
                              self.shear, img_size)

        return F.affine(img, *ret, interpolation=self.interpolation, fill=fill)
def forward ( self , img ) : fill = self . fill if isinstance ( img , Tensor ) : if isinstance ( fill , ( int , float ) ) : fill = [ float ( fill ) ] * F . _get_image_num_channels ( img ) else : fill = [ float ( f ) for f in fill ] img_size = F . _get_image_size ( img ) ret = self . get_params ( self . degrees , self . translate , self . scale , self . shear , img_size ) return F . affine ( img , * ret , interpolation = self . interpolation , fill = fill )