def register_random_generator(self, name: str, rng_def: dict):
        """
        Register a new random number generator.

        Please note that Python's `random`, NumPy, and PyTorch global generators
        are already supported out-of-the-box and should not be re-registered.

        :param name: The name of the random number generator.
        :param rng_def: The definition of the random number generator.
            This must be a dictionary including the following fields:
            `seed`: a function that initializes the internal random
            number generator, it should accept an int (the seed);
            `save_state`: a function that returns an object that can be used to
            restore the state of the random number generator. The returned
            object should be pickleable; `load_state`: a function that sets
            the internal state of the  generator based on the object passed as
            an argument. That object is the one returned from a previous call to
            `save_state`; `step`: a function that advances the state of the
            random number generator. Its return value is ignored. To advance the
            state, it is recommended to generate a small amount of random
            data, like a float (to minimize the performance impact).
        """
        rng_def_keys = set(rng_def.keys())
        if not rng_def_keys.issubset(_RNGManager.RNG_DEF_REQUIRED_FIELDS):
            raise ValueError("Invalid random number generator definition")

        self.random_generators[name] = rng_def

        Register a new random number generator.

        Please note that Python's `random`, NumPy, and PyTorch global generators
        are already supported out-of-the-box and should not be re-registered.

        :param name: The name of the random number generator.
        :param rng_def: The definition of the random number generator.
            This must be a dictionary including the following fields:
            `seed`: a function that initializes the internal random
            number generator, it should accept an int (the seed);
            `save_state`: a function that returns an object that can be used to
            restore the state of the random number generator. The returned
            object should be pickleable; `load_state`: a function that sets
            the internal state of the  generator based on the object passed as
            an argument. That object is the one returned from a previous call to
            `save_state`; `step`: a function that advances the state of the
            random number generator. Its return value is ignored. To advance the
            state, it is recommended to generate a small amount of random
            data, like a float (to minimize the performance impact).
        
avalanche/training/determinism/rng_manager.py