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, loss_config: AttrDict):
      super().__init__()
      self.loss_config = loss_config
      self.queue_start_iter = self.loss_config.get(
          "queue_start_iter", 0
      )
      self.use_teacher_prototypes = self.loss_config.get(
          "use_teacher_prototypes", False
      )
      self.use_student_prototypes = self.loss_config.get(
          "use_student_prototypes", False
      )
      self.use_two_crops_for_teacher = self.loss_config.get(
          "use_two_crops_for_teacher", True
      )
      self.normalize_student_feats = self.loss_config.get(
          "normalize_student_feats", False
      )
      self.criterion = SwAVDistillationCriterion(
          temperature=self.loss_config.temperature,
          num_crops=self.loss_config.num_crops,
          num_iters=self.loss_config.num_iters,
          epsilon=self.loss_config.epsilon,
          use_double_prec=self.loss_config.use_double_precision,
          num_prototypes=self.loss_config.num_prototypes,
          output_dir=self.loss_config.output_dir,
          temp_hard_assignment_iters=self.loss_config.temp_hard_assignment_iters,
          local_queue_length=self.loss_config.local_queue_length,
          swapped_assignment=self.loss_config.swapped_assignment,
      )
  
      # Teacher prototype scores that will be used to compute the
      # assignments for the student model crops' prototype scores
      self.teacher_prototypes_scores: Optional[torch.Tensor] = None
  
      # Teacher prototypes that will be used to compute the
      # scores for each crops of the student model
      self.teacher_prototypes: Optional[torch.Tensor] = None
  
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 SwAVDistillationLoss object from inherited base classes: ClassyLoss with example: obj = SwAVDistillationLoss(loss_config)