Skip to content

Commit 3e7cc56

Browse files
update docstring of callbacks.py
1 parent b8e39c9 commit 3e7cc56

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

ppsci/utils/callbacks.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
class InitCallback(Callback):
3333
"""Callback class for:
34-
1. Parse config dict from given yaml file and check its validity, complete missing items by its' default values.
34+
1. Parse config dict from given yaml file and check its validity.
3535
2. Fixing random seed to 'config.seed'.
3636
3. Initialize logger while creating output directory(if not exist).
3737
@@ -60,8 +60,6 @@ class InitCallback(Callback):
6060
"""
6161

6262
def on_job_start(self, config: DictConfig, **kwargs: Any) -> None:
63-
# check given cfg using pre-defined pydantic schema in 'SolverConfig', error(s) will be raised
64-
# if any checking failed at this step
6563
if importlib.util.find_spec("pydantic") is not None:
6664
from pydantic import ValidationError
6765
else:
@@ -76,8 +74,6 @@ def on_job_start(self, config: DictConfig, **kwargs: Any) -> None:
7674
# error(s) will be printed and exit program if any checking failed at this step
7775
try:
7876
_model_pydantic = config_module.SolverConfig(**dict(config))
79-
# complete missing items with default values pre-defined in pydantic schema in
80-
# 'SolverConfig'
8177
full_cfg = DictConfig(_model_pydantic.model_dump())
8278
except ValidationError as e:
8379
print(e)
@@ -100,7 +96,7 @@ def on_job_start(self, config: DictConfig, **kwargs: Any) -> None:
10096

10197
# enable prim if specified
10298
if "prim" in full_cfg and bool(full_cfg.prim):
103-
# Mostly for dy2st running, will be removed in the future
99+
# Mostly for compiler running with dy2st.
104100
from paddle.framework import core
105101

106102
core.set_prim_eager_enabled(True)

0 commit comments

Comments
 (0)