class_docstr: Implementation of the SwaV loss.
  
  Attributes:
      temperature:
          Temperature parameter used for cross entropy calculations.
      sinkhorn_iterations:
          Number of iterations of the sinkhorn algorithm.
      sinkhorn_epsilon:
          Temperature parameter used in the sinkhorn algorithm.
      sinkhorn_gather_distributed:
          If True then features from all gpus are gathered to calculate the
          soft codes in the sinkhorn algorithm.
code: def __init__(
      self,
      temperature: float = 0.1,
      sinkhorn_iterations: int = 3,
      sinkhorn_epsilon: float = 0.05,
      sinkhorn_gather_distributed: bool = False,
  ):
      super(SwaVLoss, self).__init__()
      if sinkhorn_gather_distributed and not dist.is_available():
          raise ValueError(
              "sinkhorn_gather_distributed is True but torch.distributed is not "
              "available. Please set gather_distributed=False or install a torch "
              "version with distributed support."
          )
  
      self.temperature = temperature
      self.sinkhorn_iterations = sinkhorn_iterations
      self.sinkhorn_epsilon = sinkhorn_epsilon
      self.sinkhorn_gather_distributed = sinkhorn_gather_distributed
  
file_path: lightly/lightly/loss/swav_loss.py
imports: from typing import List
  import torch
  import torch.distributed
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 1 to create a new SwaVLoss object from inherited base classes: nn with example: obj = SwaVLoss(temperature, sinkhorn_iterations, sinkhorn_epsilon, sinkhorn_gather_distributed)