class_docstr: Convert an input PIL image to Patches and Image
  This transform was proposed in PIRL - https://arxiv.org/abs/1912.01991.
  
  Input:
      PIL Image
  Returns:
      list containing N+1 elements
          + zeroth element: a RandomResizedCrop of the image
          + remainder: N patches extracted uniformly from a RandomResizedCrop
docstr: Args:
      crop_scale_image (tuple of floats): scale for RandomResizedCrop of image
      crop_size_image (int): size for RandomResizedCrop of image
      crop_scale_patches (tuple of floats): scale for RandomResizedCrop of patches
      crop_size_patches (int): size for RandomResizedCrop of patches
      permute_patches (bool): permute the patches in any order
      num_patches (int): number of patches to create. should be a square integer.
code: def __init__(
      self,
      crop_scale_image=(0.08, 1.0),
      crop_size_image=224,
      crop_scale_patches=(0.6, 1.0),
      crop_size_patches=255,
      permute_patches=True,
      num_patches=9,
  ):
      """
      Args:
          crop_scale_image (tuple of floats): scale for RandomResizedCrop of image
          crop_size_image (int): size for RandomResizedCrop of image
          crop_scale_patches (tuple of floats): scale for RandomResizedCrop of patches
          crop_size_patches (int): size for RandomResizedCrop of patches
          permute_patches (bool): permute the patches in any order
          num_patches (int): number of patches to create. should be a square integer.
      """
      assert isinstance(num_patches, int)
      splits_per_side = np.sqrt(num_patches)
      assert (
          splits_per_side**2 == num_patches
      ), "Num patches must be a perfect square integer."
      self.num_patches = num_patches
      assert len(crop_scale_image) == 2
      assert len(crop_scale_patches) == 2
  
      self.crop_image_tx = pth_transforms.RandomResizedCrop(
          scale=crop_scale_image, size=crop_size_image
      )
      self.crop_patches_tx = pth_transforms.RandomResizedCrop(
          scale=crop_scale_patches, size=crop_size_patches
      )
  
      self.image_to_patch_tx = ImgPatchesFromTensor(
          num_patches=num_patches
      )
  
file_path: vissl/vissl/data/ssl_transforms/img_pil_to_patches_and_image.py
imports: from typing import Any, Dict
  import numpy
  import PIL
  import torchvision.transforms
  from classy_vision.dataset.transforms import register_transform
  from classy_vision.dataset.transforms.classy_transform import ClassyTransform
  from vissl.data.ssl_transforms.img_patches_tensor import ImgPatchesFromTensor
label_desc: Use image node_id 1 to create a new ImgPilToPatchesAndImage object from inherited base classes: ClassyTransform with example: obj = ImgPilToPatchesAndImage(crop_scale_image, crop_size_image, crop_scale_patches, crop_size_patches, permute_patches, num_patches)