You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for your great software! I often find myself needing a pattern where I define some "child" parameter that depends on other "parent" parameters; is it possible/is there a way to ensure that a "child" parameter (e.g., B) that depends on other parameters (e.g., A) gets updated when the "parent" parameter (A) is updated?
For example:
# in config.py
from yacs.config import CfgNode as CN
_C = CN()
_C.A = 1.0
_C.B = 2.0*_C.A
cfg = _C
# in main.py
from config import cfg
if __name__ == "__main__":
cfg.merge_from_list(["A", 3.0])
cfg.B # <-------- Expected 6.0, it is 2.0
Thanks,
Andrea
The text was updated successfully, but these errors were encountered:
andretag
changed the title
Allow for params update
Update "child" params when "parent" params are modified
Aug 1, 2023
Thank you for your great software! I often find myself needing a pattern where I define some "child" parameter that depends on other "parent" parameters; is it possible/is there a way to ensure that a "child" parameter (e.g., B) that depends on other parameters (e.g., A) gets updated when the "parent" parameter (A) is updated?
For example:
Thanks,
Andrea
The text was updated successfully, but these errors were encountered: