def align_seeds(self):
        """
        Aligns the random seed for all number generators across all processes.
        """

        if not self.is_distributed:
            return

        if self.is_main_process:
            reference_seed = torch.randint(0, 2**32 - 1, (1,), dtype=torch.int64)
        else:
            reference_seed = torch.empty((1,), dtype=torch.int64)

        self.broadcast(reference_seed)
        seed = int(reference_seed)
        self.set_random_seeds(seed)

        Aligns the random seed for all number generators across all processes.
        
avalanche/distributed/distributed_helper.py