def __init__(
        self,
        post_prune_epochs: int,
        prune_proportion: t.Union[float, t.Callable[[int], float], t.List[float]] = 0.5,
    ):
        """The PackNetPlugin calls PackNet's pruning and freezing procedures at
        the appropriate times.

        :param post_prune_epochs: The number of epochs to finetune the model
            after pruning the parameters. Must be less than the number of
            training epochs.
        :param prune_proportion: The proportion of parameters to prune
            during each task. Can be a float, a list of floats, or a function
            that takes the task id and returns a float. Each value must be
            between 0 and 1.
        """
        super().__init__()
        self.post_prune_epochs = post_prune_epochs
        self.total_epochs: Union[int, None] = None
        self.prune_proportion: t.Callable[[int], float] = prune_proportion

        if isinstance(prune_proportion, float):
            assert 0 <= self.prune_proportion <= 1, (
                f"`prune_proportion` must be between 0 and 1, got "
                f"{self.prune_proportion}"
            )
            self.prune_proportion = lambda _: prune_proportion
        elif isinstance(prune_proportion, list):
            assert all(0 <= x <= 1 for x in prune_proportion), (
                "all values in `prune_proportion` must be between 0 and 1,"
                f" got {prune_proportion}"
            )
            self.prune_proportion = lambda i: prune_proportion[i]
        else:
            self.prune_proportion = prune_proportion
The PackNetPlugin calls PackNet's pruning and freezing procedures at
        the appropriate times.

        :param post_prune_epochs: The number of epochs to finetune the model
            after pruning the parameters. Must be less than the number of
            training epochs.
        :param prune_proportion: The proportion of parameters to prune
            during each task. Can be a float, a list of floats, or a function
            that takes the task id and returns a float. Each value must be
            between 0 and 1.
        
avalanche/models/packnet.py