def __init__(self, model: nn.Module, features_names=('layer4', 'avgpool')):
    self.features: List[np.ndarray] = []
    for name in features_names:
        model._modules.get(name).register_forward_hook(self)
def __init__(self, model: nn.Module, features_names=('layer4', 'avgpool')):
    self.features: List[np.ndarray] = []
    for name in features_names:
        model._modules.get(name).register_forward_hook(self)