def drop_previous_experiences(self, to_exp: int) -> None:
        """
        Drop the reference to experiences up to a certain experience ID
        (inclusive).

        This means that experiences with ID [0, from_exp] will be released.
        Beware that the associated object will be valid until all the references
        to it are dropped.

        :param to_exp: The ID of the last exp to drop (inclusive). If None,
            the whole stream will be loaded. Can be a negative number, in
            which case this method doesn't have any effect. Can be greater
            or equal to the stream length, in which case all currently loaded
            experiences will be dropped.
        :return: None
        """

        to_exp = int(to_exp)  # Handle single element tensors
        if to_exp < 0:
            return

        to_exp = min(to_exp, len(self) - 1)

        for exp_id in range(0, to_exp + 1):
            if exp_id in self._loaded_experiences:
                del self._loaded_experiences[exp_id]

        Drop the reference to experiences up to a certain experience ID
        (inclusive).

        This means that experiences with ID [0, from_exp] will be released.
        Beware that the associated object will be valid until all the references
        to it are dropped.

        :param to_exp: The ID of the last exp to drop (inclusive). If None,
            the whole stream will be loaded. Can be a negative number, in
            which case this method doesn't have any effect. Can be greater
            or equal to the stream length, in which case all currently loaded
            experiences will be dropped.
        :return: None
        
avalanche/benchmarks/scenarios/deprecated/lazy_dataset_sequence.py