(self, hook_dict, layer_name: str, last_layer_to_extract: str)
| 276 | |
| 277 | class ForwardHook: |
| 278 | def __init__(self, hook_dict, layer_name: str, last_layer_to_extract: str): |
| 279 | self.hook_dict = hook_dict |
| 280 | self.layer_name = layer_name |
| 281 | self.raise_exception_to_break = copy.deepcopy( |
| 282 | layer_name == last_layer_to_extract |
| 283 | ) |
| 284 | |
| 285 | def __call__(self, module, input, output): |
| 286 | self.hook_dict[self.layer_name] = output |
nothing calls this directly
no outgoing calls
no test coverage detected