def _pn_apply(self, func: t.Callable[["PackNetModel"], None]):
        """Apply a function to all child PackNetModules

        :param func: The function to apply
        """

        @torch.no_grad()
        def __pn_apply(module):
            # Apply function to all child PackNetModule but not other
            # parent PackNet modules
            if isinstance(module, PackNetModule) and not isinstance(
                module, PackNetModel
            ):
                func(module)

        self.apply(__pn_apply)
Apply a function to all child PackNetModules

        :param func: The function to apply
        
avalanche/models/packnet.py