code: def swav_loss(
      embedding_dim: int = 128,
      temperature: float = 0.1,
      use_double_precision: bool = False,
      normalize_last_layer: bool = True,
      num_iters: int = 3,
      epsilon: float = 0.05,
      num_crops: int = 8,
      crops_for_assign: List[int] = [0, 1],
      num_prototypes: Union[int, List[int]] = 3000,
      temp_hard_assignment_iters: int = 0,
      output_dir: str = ".",
      queue_length: int = 0,
      start_iter: int = 0,
      local_queue_length: int = 0,
      **kwargs,
  ) -> ClassyLoss:
      loss_name = "swav_loss"
      cfg = AttrDict(
          {
              "embedding_dim": embedding_dim,
              "temperature": temperature,
              "use_double_precision": use_double_precision,
              "normalize_last_layer": normalize_last_layer,
              "num_iters": num_iters,
              "epsilon": epsilon,
              "num_crops": num_crops,
              "crops_for_assign": crops_for_assign,
              "num_prototypes": [num_prototypes]
              if isinstance(num_prototypes, int)
              else num_prototypes,
              "temp_hard_assignment_iters": temp_hard_assignment_iters,
              "output_dir": output_dir,
              "queue": AttrDict(
                  {
                      "queue_length": queue_length,
                      "start_iter": start_iter,
                      "local_queue_length": local_queue_length,
                  }
              ),
          }
      )
  
      return get_loss_fn(loss_name, cfg)
  
file_path: lightning-flash/src/flash/image/embedding/losses/vissl_losses.py
imports: from typing import List, Union
  from torch import Tensor
  from flash.core.registry import FlashRegistry
  from flash.core.utilities.imports import _VISSL_AVAILABLE
label_desc: Use image node_id 3 for calling a global function with example usage: swav_loss(embedding_dim, temperature, use_double_precision, normalize_last_layer, num_iters, epsilon, num_crops, crops_for_assign, num_prototypes, temp_hard_assignment_iters, output_dir, queue_length, start_iter, local_queue_length) and returns: get_loss_fn