ee54f9cf5f121b7883d09f4b9b144783047a2563,mmcv/torchpack/runner/runner.py,Runner,register_training_hooks,#Runner#Any#Any#Any#Any#,331
Before Change
if checkpoint_config is None:
checkpoint_config = {}
self.register_lr_hooks(lr_config)
self.register_hook(OptimizerStepperHook(**grad_clip_config))
self.register_hook(CheckpointSaverHook(**checkpoint_config))
self.register_hook(IterTimerHook())
if log_config is not None:
self.register_logger_hooks(log_config)
After Change
checkpoint_config = {}
self.register_lr_hooks(lr_config)
if isinstance(grad_clip_config, Hook):
self.register_hook(grad_clip_config)
elif isinstance(grad_clip_config, dict):
self.register_hook(OptimizerStepperHook(**grad_clip_config))
else:
raise TypeError(
"OptimizerStepperHook should be a Hook object or dict, not {}".
format(type(grad_clip_config)))
self.register_hook(CheckpointSaverHook(**checkpoint_config))
self.register_hook(IterTimerHook())
if log_config is not None:
self.register_logger_hooks(log_config)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances Project Name: open-mmlab/mmcv
Commit Name: ee54f9cf5f121b7883d09f4b9b144783047a2563
Time: 2018-09-17
Author: pjmzju@gmail.com
File Name: mmcv/torchpack/runner/runner.py
Class Name: Runner
Method Name: register_training_hooks
Project Name: elbayadm/attn2d
Commit Name: 866d0d2e3d7056e7523128afd87fca15bf4e4dbc
Time: 2018-11-28
Author: myleott@fb.com
File Name: fairseq/legacy_distributed_data_parallel.py
Class Name: LegacyDistributedDataParallel
Method Name: _register_grad_hook