Call all hooks. Args: fn_name (str): The function name in each hook to be called, such as "before_train_epoch".
(self, fn_name: str)
| 1388 | return [h for h in self._hooks if h.__class__ == cls] |
| 1389 | |
| 1390 | def invoke_hook(self, fn_name: str) -> None: |
| 1391 | """Call all hooks. |
| 1392 | |
| 1393 | Args: |
| 1394 | fn_name (str): The function name in each hook to be called, such as |
| 1395 | "before_train_epoch". |
| 1396 | """ |
| 1397 | for hook in self._hooks: |
| 1398 | if hasattr(hook, fn_name): |
| 1399 | getattr(hook, fn_name)(self) |
| 1400 | |
| 1401 | def print_cfg(self): |
| 1402 | if is_master(): |
no outgoing calls