class_docstr: Implementation of Jigsaw image augmentation, inspired from PyContrast library.
  
  Generates n_grid**2 random crops and returns a list.
  
  This augmentation is instrumental to PIRL.
  
  Attributes:
      n_grid:
          Side length of the meshgrid, sqrt of the number of crops.
      img_size:
          Size of image.
      crop_size:
          Size of crops.
      transform:
          Transformation to apply on each crop.
  
  Examples:
      >>> from lightly.transforms import Jigsaw
      >>>
      >>> jigsaw_crop = Jigsaw(n_grid=3, img_size=255, crop_size=64, transform=transforms.ToTensor())
      >>>
      >>> # img is a PIL image
      >>> crops = jigsaw_crops(img)
code: def __init__(
      self,
      n_grid: int = 3,
      img_size: int = 255,
      crop_size: int = 64,
      transform: T.Compose = T.ToTensor(),
  ):
      self.n_grid = n_grid
      self.img_size = img_size
      self.crop_size = crop_size
      self.grid_size = int(img_size / self.n_grid)
      self.side = self.grid_size - self.crop_size
      self.transform = transform
  
      yy, xx = np.meshgrid(np.arange(n_grid), np.arange(n_grid))
      self.yy = np.reshape(yy * self.grid_size, (n_grid * n_grid,))
      self.xx = np.reshape(xx * self.grid_size, (n_grid * n_grid,))
  
file_path: lightly/lightly/transforms/jigsaw.py
imports: from typing import List
  import numpy
  import torch
  from PIL import Image
  from PIL.Image import Image
  from torch import Tensor
  from torchvision import transforms
label_desc: Use image node_id 1 to create a new Jigsaw object from inherited base classes: object with example: obj = Jigsaw(n_grid, img_size, crop_size, transform)