class_docstr: This loss allows to distill a SwAV model
class_docstr_tok: ["This","loss","allows","to","distill","a","SwAV","model"]
code: def __init__(
      self,
      temperature: float,
      num_crops: int,
      num_iters: int,
      epsilon: float,
      use_double_prec: bool,
      num_prototypes: List[int],
      output_dir: str,
      temp_hard_assignment_iters: int,
      local_queue_length: int,
      swapped_assignment: bool,
  ):
      super().__init__()
      self.temperature = temperature
      self.num_crops = num_crops
      self.nmb_sinkhornknopp_iters = num_iters
      self.epsilon = epsilon
      self.use_double_prec = use_double_prec
      self.num_prototypes = num_prototypes
      self.nmb_heads = len(self.num_prototypes)
      self.output_dir = output_dir
      self.temp_hard_assignment_iters = temp_hard_assignment_iters
      self.local_queue_max_length = local_queue_length
      self.swapped_assignment = swapped_assignment
  
      self.dist_rank = get_rank()
      self.world_size = get_world_size()
      self.log_softmax = nn.LogSoftmax(dim=1).cuda()
      self.softmax = nn.Softmax(dim=1).cuda()
      self.register_buffer("num_iteration", torch.zeros(1, dtype=int))
      self.use_gpu = get_cuda_device_index() > -1
      self.use_queue = False
      if self.local_queue_max_length > 0:
          self._init_teacher_scores_queue()
  
imports: import logging
  import os
  import pprint
  from typing import List, Optional, Union
  import numpy
  import torch
  import torch.nn.functional
  from classy_vision.generic.distributed_util import all_reduce_max, get_cuda_device_index, get_rank, get_world_size
  from classy_vision.losses import ClassyLoss, register_loss
  from fvcore.common.file_io import PathManager
  from torch import nn
  from vissl.config import AttrDict
  from vissl.losses.distibuted_sinkhornknopp import distributed_sinkhornknopp
label_desc: Use image node_id 1 to create a new SwAVDistillationCriterion object from inherited base classes: nn with example: obj = SwAVDistillationCriterion(temperature, num_crops, num_iters, epsilon, use_double_prec, num_prototypes, output_dir, temp_hard_assignment_iters, local_queue_length, swapped_assignment)