class_docstr: This loss allows to distill a SwAV model
class_docstr_tok: ["This","loss","allows","to","distill","a","SwAV","model"]
code: def forward(
      self,
      student_outputs: Union[List[torch.Tensor], torch.Tensor],
      target: torch.Tensor,
  ):
      # Useful for heads such as DINO heads returning a list
      # Not useful for heads such as MLP returning a single tensor
      if isinstance(student_outputs, list):
          if self.use_student_prototypes:
              student_outputs = student_outputs[1]
          else:
              student_outputs = student_outputs[0]
  
      # Optional use of queue or normalization of student features
      self.criterion.use_queue = (
          self.criterion.local_queue_max_length > 0
          and self.criterion.num_iteration >= self.queue_start_iter
      )
      if self.normalize_student_feats:
          student_outputs = nn.functional.normalize(
              student_outputs, dim=-1, p=2
          )
  
      # Forward to distillation criterion
      loss = self.criterion(
          student_outputs,
          self.teacher_prototypes_scores,
          self.teacher_prototypes
          if self.use_teacher_prototypes
          else None,
      )
      self.criterion.num_iteration += 1
      if self.criterion.use_queue:
          self.criterion.add_to_teacher_scores_queue(
              self.teacher_prototypes_scores
          )
      return loss
  
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 3 for calling the SwAVDistillationLoss obj's underlying member method code with example usage: obj.forward(student_outputs, target) and returns: loss