Skip to content

Commit

Permalink
[Docs] Fix docstring format (#816)
Browse files Browse the repository at this point in the history
* [Docs] Fix docstring format

* minor refine

* minor refine
  • Loading branch information
zhouzaida committed Dec 12, 2022
1 parent 3987602 commit bf5c265
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
17 changes: 9 additions & 8 deletions mmengine/optim/optimizer/default_constructor.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,21 +66,22 @@ class DefaultOptimWrapperConstructor:
Args:
optim_wrapper_cfg (dict): The config dict of the optimizer wrapper.
Positional fields are
- ``type``: class name of the OptimizerWrapper
- ``optimizer``: The configuration of optimizer.
Required fields of ``optim_wrapper_cfg`` are
Optional fields are
- ``type``: class name of the OptimizerWrapper
- ``optimizer``: The configuration of optimizer.
- any arguments of the corresponding optimizer wrapper type,
e.g., accumulative_counts, clip_grad, etc.
Optional fields of ``optim_wrapper_cfg`` are
The positional fields of ``optimizer`` are
- any arguments of the corresponding optimizer wrapper type,
e.g., accumulative_counts, clip_grad, etc.
Required fields of ``optimizer`` are
- `type`: class name of the optimizer.
Optional fields are
Optional fields of ``optimizer`` are
- any arguments of the corresponding optimizer type, e.g.,
lr, weight_decay, momentum, etc.
Expand Down
13 changes: 6 additions & 7 deletions mmengine/visualization/vis_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,14 +498,13 @@ class TensorboardVisBackend(BaseVisBackend):
Examples:
>>> from mmengine.visualization import TensorboardVisBackend
>>> import numpy as np
>>> tensorboard_vis_backend = \
>>> TensorboardVisBackend(save_dir='temp_dir')
>>> img=np.random.randint(0, 256, size=(10, 10, 3))
>>> tensorboard_vis_backend.add_image('img', img)
>>> tensorboard_vis_backend.add_scaler('mAP', 0.6)
>>> tensorboard_vis_backend.add_scalars({'loss': 0.1,'acc':0.8})
>>> vis_backend = TensorboardVisBackend(save_dir='temp_dir')
>>> img = np.random.randint(0, 256, size=(10, 10, 3))
>>> vis_backend.add_image('img', img)
>>> vis_backend.add_scaler('mAP', 0.6)
>>> vis_backend.add_scalars({'loss': 0.1,'acc':0.8})
>>> cfg = Config(dict(a=1, b=dict(b1=[0, 1])))
>>> tensorboard_vis_backend.add_config(cfg)
>>> vis_backend.add_config(cfg)
Args:
save_dir (str): The root directory to save the files
Expand Down

0 comments on commit bf5c265

Please sign in to comment.