def METHOD_NAME(seed: int):
    """Seed all rng objects.
    .. note::
        When using the :class:`.Trainer`, you can use the ``seed`` parameter
        instead of invoking this function directly.
        For example:
        .. doctest::
            >>> trainer = Trainer(seed=42)
        However, to configure the random seed for operations before the trainer is initialized, manually invoke this
        function at the beginning of your training script.
    Args:
        seed (int): The random seed
    """
    if seed < 0 or seed > MAX_SEED:
        raise ValueError(f'Seed {seed} is invalid. It must be on [0; 2^32 - 1]')
    log.info('Setting seed to %d', seed)
    random.seed(seed)
    np.random.seed(seed)
    torch.manual_seed(seed)
    # torch.manual_seed may call manual_seed_all but calling it again here
    # to make sure it gets called at least once
    torch.cuda.manual_seed_all(seed)