class_docstr: This criterion is used by the SwAV paper https://arxiv.org/abs/2006.09882
  by Caron et al. See the paper for more details about the loss.
  
  Config params:
      embedding_dim (int):            the projection head output dimension
      temperature (float):            temperature to be applied to the logits
  
      num_iters (int):                number of sinkhorn algorithm iterations to make
      epsilon (float):                see the paper for details
      num_crops (int):                number of crops used
      crops_for_assign (List[int]):   what crops to use for assignment
      num_prototypes (List[int]):     number of prototypes
      temp_hard_assignment_iters (int): whether to do hard assignment for the initial
                                      few iterations
      output_dir (str):               for dumping the debugging info in case loss
                                      becomes NaN
      local_queue_length (int):   length of queue per gpu
class_docstr_tok: ["This","criterion","is","used","by","the","SwAV","paper","https",":","\/\/arxiv.org\/abs\/2006.09882","by","Caron","et","al",".","See","the","paper","for","more","details","about","the","loss",".","Config","params",":","embedding_dim","(","int",")",":","the","projection","head","output","dimension","temperature","(","float",")",":","temperature","to","be","applied","to","the","logits","num_iters","(","int",")",":","number","of","sinkhorn","algorithm","iterations","to","make","epsilon","(","float",")",":","see","the","paper","for","details","num_crops","(","int",")",":","number","of","crops","used","crops_for_assign","(","List","[","int","]",")",":","what","crops","to","use","for","assignment","num_prototypes","(","List","[","int","]",")",":","number","of","prototypes","temp_hard_assignment_iters","(","int",")",":","whether","to","do","hard","assignment","for","the","initial","few","iterations","output_dir","(","str",")",":","for","dumping","the","debugging","info","in","case","loss","becomes","NaN","local_queue_length","(","int",")",":","length","of","queue","per","gpu"]
code: def compute_queue_scores(self, head):
      with torch.no_grad():
          for crop_id in range(len(self.crops_for_assign)):
              for i in range(head.nmb_heads):
                  scores = getattr(head, "prototypes" + str(i))(
                      self.local_emb_queue[crop_id]
                  )
                  getattr(self, "local_queue" + str(i))[
                      crop_id
                  ] = scores
  
imports: import logging
  import math
  import os
  import pprint
  from typing import List
  import numpy
  import torch
  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 iopath.common.file_io import g_pathmgr
  from torch import nn
  from vissl.config import AttrDict
  from vissl.losses.distibuted_sinkhornknopp import distributed_sinkhornknopp
  from vissl.losses.distibuted_sinkhornknopp_powerlaw import distributed_sinkhorn_powerlaw
label_desc: Use image node_id 4 for calling the SwAVCriterion obj's underlying member method code with example usage: obj.compute_queue_scores(head) without return types