class_docstr: Transforms images for VICRegL.
  
  Attributes:
      global_crop_size:
          Size of the input image in pixels for the global crop category.
      local_crop_size:
          Size of the input image in pixels for the local crop category.
      global_crop_scale:
          Min and max scales for the global crop category.
      local_crop_scale:
          Min and max scales for the local crop category.
      global_grid_size:
          Grid size for the global crop category.
      local_grid_size:
          Grid size for the local crop category.
      global_gaussian_blur_prob:
          Probability of Gaussian blur for the global crop category.
      local_gaussian_blur_prob:
          Probability of Gaussian blur for the local crop category.
      global_gaussian_blur_kernel_size:
          Will be deprecated in favor of `global_gaussian_blur_sigmas` argument. If set, the old behavior applies and `global_gaussian_blur_sigmas` is ignored.
          Used to calculate sigma of gaussian blur with global_gaussian_blur_kernel_size * input_size. Applied to global crop category.
      local_gaussian_blur_kernel_size:
          Will be deprecated in favor of `local_gaussian_blur_sigmas` argument. If set, the old behavior applies and `local_gaussian_blur_sigmas` is ignored.
          Used to calculate sigma of gaussian blur with local_gaussian_blur_kernel_size * input_size. Applied to local crop category.
      global_gaussian_blur_sigmas:
          Tuple of min and max value from which the std of the gaussian kernel is sampled.
          Is ignored if `global_gaussian_blur_kernel_size` is set. Applied to global crop category.
      local_gaussian_blur_sigmas:
          Tuple of min and max value from which the std of the gaussian kernel is sampled.
          Is ignored if `local_gaussian_blur_kernel_size` is set. Applied to local crop category.
      global_solarize_prob:
          Probability of solarization for the global crop category.
      local_solarize_prob:
          Probability of solarization for the local crop category.
      hf_prob:
          Probability that horizontal flip is applied.
      cj_prob:
          Probability that color jitter is applied.
      cj_strength:
          Strength of the color jitter.
      random_gray_scale:
          Probability of conversion to grayscale.
      normalize:
          Dictionary with mean and standard deviation for normalization.
class_docstr_tok: ["Transforms","images","for","VICRegL",".","Attributes",":","global_crop_size",":","Size","of","the","input","image","in","pixels","for","the","global","crop","category",".","local_crop_size",":","Size","of","the","input","image","in","pixels","for","the","local","crop","category",".","global_crop_scale",":","Min","and","max","scales","for","the","global","crop","category",".","local_crop_scale",":","Min","and","max","scales","for","the","local","crop","category",".","global_grid_size",":","Grid","size","for","the","global","crop","category",".","local_grid_size",":","Grid","size","for","the","local","crop","category",".","global_gaussian_blur_prob",":","Probability","of","Gaussian","blur","for","the","global","crop","category",".","local_gaussian_blur_prob",":","Probability","of","Gaussian","blur","for","the","local","crop","category",".","global_gaussian_blur_kernel_size",":","Will","be","deprecated","in","favor","of","`","global_gaussian_blur_sigmas","`","argument",".","If","set",",","the","old","behavior","applies","and","`","global_gaussian_blur_sigmas","`","is","ignored",".","Used","to","calculate","sigma","of","gaussian","blur","with","global_gaussian_blur_kernel_size","*","input_size",".","Applied","to","global","crop","category",".","local_gaussian_blur_kernel_size",":","Will","be","deprecated","in","favor","of","`","local_gaussian_blur_sigmas","`","argument",".","If","set",",","the","old","behavior","applies","and","`","local_gaussian_blur_sigmas","`","is","ignored",".","Used","to","calculate","sigma","of","gaussian","blur","with","local_gaussian_blur_kernel_size","*","input_size",".","Applied","to","local","crop","category",".","global_gaussian_blur_sigmas",":","Tuple","of","min","and","max","value","from","which","the","std","of","the","gaussian","kernel","is","sampled",".","Is","ignored","if","`","global_gaussian_blur_kernel_size","`","is","set",".","Applied","to","global","crop","category",".","local_gaussian_blur_sigmas",":","Tuple","of","min","and","max","value","from","which","the","std","of","the","gaussian","kernel","is","sampled",".","Is","ignored","if","`","local_gaussian_blur_kernel_size","`","is","set",".","Applied","to","local","crop","category",".","global_solarize_prob",":","Probability","of","solarization","for","the","global","crop","category",".","local_solarize_prob",":","Probability","of","solarization","for","the","local","crop","category",".","hf_prob",":","Probability","that","horizontal","flip","is","applied",".","cj_prob",":","Probability","that","color","jitter","is","applied",".","cj_strength",":","Strength","of","the","color","jitter",".","random_gray_scale",":","Probability","of","conversion","to","grayscale",".","normalize",":","Dictionary","with","mean","and","standard","deviation","for","normalization","."]
code: def __init__(
      self,
      global_crop_size: int = 224,
      local_crop_size: int = 96,
      global_crop_scale: Tuple[int] = (0.2, 1.0),
      local_crop_scale: Tuple[int] = (0.05, 0.2),
      global_grid_size: int = 7,
      local_grid_size: int = 3,
      global_gaussian_blur_prob: float = 0.5,
      local_gaussian_blur_prob: float = 0.1,
      global_gaussian_blur_kernel_size: Optional[float] = None,
      local_gaussian_blur_kernel_size: Optional[float] = None,
      global_gaussian_blur_sigmas: Tuple[float, float] = (0.2, 2),
      local_gaussian_blur_sigmas: Tuple[float, float] = (0.2, 2),
      global_solarize_prob: float = 0.0,
      local_solarize_prob: float = 0.2,
      hf_prob: float = 0.5,
      cj_prob: float = 1.0,
      cj_strength: float = 0.5,
      random_gray_scale: float = 0.2,
      normalize: dict = imagenet_normalize,
  ):
      _deprecation_warning_collate_functions()
      super().__init__()
      self.global_crop_and_flip = RandomResizedCropAndFlip(
          crop_size=global_crop_size,
          crop_min_scale=global_crop_scale[0],
          crop_max_scale=global_crop_scale[1],
          hf_prob=hf_prob,
          grid_size=global_grid_size,
      )
      self.local_crop_and_flip = RandomResizedCropAndFlip(
          crop_size=local_crop_size,
          crop_min_scale=local_crop_scale[0],
          crop_max_scale=local_crop_scale[1],
          hf_prob=hf_prob,
          grid_size=local_grid_size,
      )
  
      color_jitter = T.ColorJitter(
          0.8 * cj_strength,
          0.8 * cj_strength,
          0.4 * cj_strength,
          0.2 * cj_strength,
      )
      self.global_transform = T.Compose(
          [
              T.RandomApply([color_jitter], p=cj_prob),
              T.RandomGrayscale(p=random_gray_scale),
              GaussianBlur(
                  kernel_size=global_gaussian_blur_kernel_size,
                  prob=global_gaussian_blur_prob,
                  sigmas=global_gaussian_blur_sigmas,
              ),
              RandomSolarization(prob=global_solarize_prob),
              T.ToTensor(),
              T.Normalize(mean=normalize["mean"], std=normalize["std"]),
          ]
      )
  
      self.local_transform = T.Compose(
          [
              T.RandomApply([color_jitter], p=cj_prob),
              T.RandomGrayscale(p=random_gray_scale),
              GaussianBlur(
                  kernel_size=local_gaussian_blur_kernel_size,
                  prob=local_gaussian_blur_prob,
                  sigmas=local_gaussian_blur_sigmas,
              ),
              RandomSolarization(prob=local_solarize_prob),
              T.ToTensor(),
              T.Normalize(mean=normalize["mean"], std=normalize["std"]),
          ]
      )
  
imports: import math
  from multiprocessing import Value
  from typing import List, Optional, Tuple, Union
  from warnings import warn
  import torch
  import torch.nn
  import torchvision
  import torchvision.transforms
  from PIL import Image
  from lightly.transforms import GaussianBlur, Jigsaw, RandomSolarization
  from lightly.transforms.random_crop_and_flip_with_grid import RandomResizedCropAndFlip
  from lightly.transforms.rotation import random_rotation_transform
  from lightly.transforms.utils import IMAGENET_NORMALIZE
label_desc: Use image node_id 1 to create a new VICRegLCollateFunction object from inherited base classes: nn with example: obj = VICRegLCollateFunction(global_crop_size, local_crop_size, global_crop_scale, local_crop_scale, global_grid_size, local_grid_size, global_gaussian_blur_prob, local_gaussian_blur_prob, global_gaussian_blur_kernel_size, local_gaussian_blur_kernel_size, global_gaussian_blur_sigmas, local_gaussian_blur_sigmas, global_solarize_prob, local_solarize_prob, hf_prob, cj_prob, cj_strength, random_gray_scale, normalize)