def seed_generator(generator, logger, seed=0):
    """Set seed for Dataloader generators. DataLoader will reseed workers the
    "Randomness in multi-process data loading" algorithm. Use `generator` to
    preserve reproducibility. For more information, see
    https://pytorch.org/docs/stable/notes/randomness.html.

    Parameters
    ----------
    generator : torch.Generator
    logger : logging.Logger object
    seed : int
        Seed for random number generators.
        Default: 0

    Returns
    -------
    generator : torch.Generator
        Seeded torch generator
    """
    generator.manual_seed(seed)

    msg = f"Dataloader generator with seed {seed} has been created."
    logger.info(msg)

    return generator