def __init__(
        self,
        temperature: float = 0.1,
        sinkhorn_iterations: int = 3,
        sinkhorn_epsilon: float = 0.05,
        sinkhorn_gather_distributed: bool = False,
    ):
        """Initializes the SwaVLoss module with the specified parameters.

        Args:
            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, features from all GPUs are gathered to calculate the
                soft codes in the sinkhorn algorithm.

        Raises:
            ValueError: If sinkhorn_gather_distributed is True but torch.distributed
                is not available.
        """
        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
Initializes the SwaVLoss module with the specified parameters.

        Args:
            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, features from all GPUs are gathered to calculate the
                soft codes in the sinkhorn algorithm.

        Raises:
            ValueError: If sinkhorn_gather_distributed is True but torch.distributed
                is not available.
        
lightly/loss/swav_loss.py