def __init__(self, lambda_param: float = 5e-3, gather_distributed: bool = False):
        """Lambda param configuration with default value like in [0]

        Initializes the BarlowTwinsLoss with the specified parameters.

        Args:
            lambda_param:
                Parameter for importance of redundancy reduction term.
            gather_distributed:
                If True, the cross-correlation matrices from all GPUs are
                gathered and summed before the loss calculation.

        Raises:
            ValueError: If gather_distributed is True but torch.distributed is not available.
        """
        super(BarlowTwinsLoss, self).__init__()
        self.lambda_param = lambda_param
        self.gather_distributed = gather_distributed

        if gather_distributed and not dist.is_available():
            raise ValueError(
                "gather_distributed is True but torch.distributed is not available."
                "Please set gather_distributed=False or install a torch version with "
                "distributed support."
            )
Lambda param configuration with default value like in [0]

        Initializes the BarlowTwinsLoss with the specified parameters.

        Args:
            lambda_param:
                Parameter for importance of redundancy reduction term.
            gather_distributed:
                If True, the cross-correlation matrices from all GPUs are
                gathered and summed before the loss calculation.

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