def METHOD_NAME(self, evaluator: Evaluator):
    def collector(buffer: List, target: torch.Tensor) -> Callable[[torch.Tensor], None]:
        # a factory function, return a tensor hook function for target
        assert len(buffer) == 0, 'Buffer pass to taylor pruner collector is not empty.'
        def collect_taylor(grad: torch.Tensor):
            if len(buffer) == 0:
                buffer.append(torch.zeros_like(grad))
            if self._current_step < self.training_steps:
                buffer[0] += (target.detach() * grad.detach()).pow(2)
        return collect_taylor
    hook_list = []
    for module_name, ts in self._target_spaces.items():
        for target_name, target_space in ts.items():
            if is_active_target(target_space):
                # TODO: add input/output
                if target_space.type is TargetType.PARAMETER:
                    assert target_space.target is not None
                    hook = TensorHook(target_space.target,
                                      target_name,
                                      functools.partial(collector, target=target_space.target))
                    hook_list.append(hook)
                    self.hooks[module_name][target_name] = hook
                else:
                    raise NotImplementedError()
    evaluator.register_hooks(hook_list)