def wrap(wrappee: nn.Module):
        """Upgrade a PyTorch module and all of its submodules to be PackNet
        compatible. This is a recursive function that will wrap all submodules
        in a PackNet compatible module.

        :param wrappee: The module to wrap
        :raises ValueError: If the module is not supported
        :return: A PackNet compatible module
        """
        # Weight norm is not supported
        if hasattr(wrappee, "weight_g") and hasattr(wrappee, "weight_v"):
            raise ValueError("PackNet does not support weight norm")
        # Other norms are not supported
        if hasattr(wrappee, "running_mean") or hasattr(wrappee, "running_var"):
            raise ValueError(
                "The PackNet implementation does not yet support norms "
                f"{wrappee.__class__.__name__}"
            )

        # Recursive cases
        if isinstance(wrappee, PackNetModule):
            return wrappee
        elif isinstance(wrappee, nn.Linear):
            return _PnLinear(wrappee)
        elif isinstance(wrappee, (nn.Conv1d, nn.Conv2d, nn.Conv3d)):
            return _PnConvNd(wrappee)
        elif isinstance(
            wrappee, (nn.ConvTranspose1d, nn.ConvTranspose2d, nn.ConvTranspose3d)
        ):
            return _PnConvTransposedNd(wrappee)
        elif isinstance(wrappee, nn.Sequential):
            # Wrap each submodule
            for i, x in enumerate(wrappee):
                wrappee[i] = PackNetModel.wrap(x)
            return wrappee

        # If the module has parameters and has not been wrapped yet, then it is
        # not supported
        if len(list(wrappee.parameters(recurse=False))) != 0:
            raise ValueError(
                f"PackNet does not support the module {wrappee.__class__.__name__}"
            )

        for submodule_name, submodule in wrappee.named_children():
            setattr(wrappee, submodule_name, PackNetModel.wrap(submodule))
        return wrappee
Upgrade a PyTorch module and all of its submodules to be PackNet
        compatible. This is a recursive function that will wrap all submodules
        in a PackNet compatible module.

        :param wrappee: The module to wrap
        :raises ValueError: If the module is not supported
        :return: A PackNet compatible module
        
avalanche/models/packnet.py