Affine transformation pytorch. img (PIL Image or Tensor) – image to transform.