Shortcuts

mmedit.engine.hooks.iter_time_hook

Module Contents

Classes

GenIterTimerHook

GenIterTimerHooks inherits from mmengine.hooks.IterTimerHook

Attributes

DATA_BATCH

mmedit.engine.hooks.iter_time_hook.DATA_BATCH[source]
class mmedit.engine.hooks.iter_time_hook.GenIterTimerHook[source]

Bases: mmengine.hooks.IterTimerHook

GenIterTimerHooks inherits from mmengine.hooks.IterTimerHook and overwrites self._after_iter().

This hooks should be used along with mmedit.engine.runner.GenValLoop and mmedit.engine.runner.GenTestLoop.

_after_iter(runner, batch_idx: int, data_batch: DATA_BATCH = None, outputs: Optional[Union[dict, Sequence[mmengine.structures.BaseDataElement]]] = None, mode: str = 'train') None[source]

Calculating time for an iteration and updating “time” HistoryBuffer of runner.message_hub. If mode is ‘train’, we take runner.max_iters as the total iterations and calculate the rest time. If mode in val or test, we use runner.val_loop.total_length or runner.test_loop.total_length as total number of iterations. If you want to know how total_length is calculated, please refers to mmedit.engine.runner.GenValLoop.run() and mmedit.engine.runner.GenTestLoop.run().

Parameters
  • runner (Runner) – The runner of the training validation and testing process.

  • batch_idx (int) – The index of the current batch in the loop.

  • data_batch (Sequence[dict], optional) – Data from dataloader. Defaults to None.

  • outputs (dict or sequence, optional) – Outputs from model. Defaults to None.

  • mode (str) – Current mode of runner. Defaults to ‘train’.

Read the Docs v: latest
Versions
master
latest
stable
zyh-re-docs
zyh-doc-notfound-extend
zyh-api-rendering
Downloads
pdf
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.