Source code for monitorch.preprocessor.abstract.abstract_module_preprocessor
from abc import abstractmethod
from .abstract_preprocessor import AbstractPreprocessor
[docs]
class AbstractModulePreprocessor(AbstractPreprocessor):
"""
Base class for all preprocessors that process module on its own.
Does not restrict usage by requiring inputs, outputs or gradients of module.
"""
[docs]
@abstractmethod
def process_module(self, name: str, module):
"""
Processes module.
Parameters
----------
name : str
Name of the module.
module : torch.nn.Module
The module object.
"""
pass