[misc] update pre-commit and run all files (#4752)

* [misc] update pre-commit

* [misc] run pre-commit

* [misc] remove useless configuration files

* [misc] ignore cuda for clang-format
This commit is contained in:
Hongxin Liu
2023-09-19 14:20:26 +08:00
committed by GitHub
parent 3c6b831c26
commit 079bf3cb26
1268 changed files with 50037 additions and 38444 deletions

View File

@@ -18,24 +18,16 @@ class BaseHook(ABC):
self.priority = priority
def after_hook_is_attached(self, trainer):
"""Actions after hooks are attached to trainer.
"""
pass
"""Actions after hooks are attached to trainer."""
def before_train(self, trainer):
"""Actions before training.
"""
pass
"""Actions before training."""
def after_train(self, trainer):
"""Actions after training.
"""
pass
"""Actions after training."""
def before_train_iter(self, trainer):
"""Actions before running a training iteration.
"""
pass
"""Actions before running a training iteration."""
def after_train_iter(self, trainer, output: Tensor, label: Tensor, loss: Tensor):
"""Actions after running a training iteration.
@@ -46,42 +38,27 @@ class BaseHook(ABC):
label (:class:`torch.Tensor`): Labels of the input data.
loss (:class:`torch.Tensor`): Loss between the output and input data.
"""
pass
def before_train_epoch(self, trainer):
"""Actions before starting a training epoch.
"""
pass
"""Actions before starting a training epoch."""
def after_train_epoch(self, trainer):
"""Actions after finishing a training epoch.
"""
pass
"""Actions after finishing a training epoch."""
def before_test(self, trainer):
"""Actions before evaluation.
"""
pass
"""Actions before evaluation."""
def after_test(self, trainer):
"""Actions after evaluation.
"""
pass
"""Actions after evaluation."""
def before_test_epoch(self, trainer):
"""Actions before starting a testing epoch.
"""
pass
"""Actions before starting a testing epoch."""
def after_test_epoch(self, trainer):
"""Actions after finishing a testing epoch.
"""
pass
"""Actions after finishing a testing epoch."""
def before_test_iter(self, trainer):
"""Actions before running a testing iteration.
"""
pass
"""Actions before running a testing iteration."""
def after_test_iter(self, trainer, output: Tensor, label: Tensor, loss: Tensor):
"""Actions after running a testing iteration.
@@ -92,7 +69,6 @@ class BaseHook(ABC):
label (:class:`torch.Tensor`): Labels of the input data
loss (:class:`torch.Tensor`): Loss between the output and input data
"""
pass
def init_runner_states(self, trainer, key, val):
"""Initializes trainer's state.