【发布时间】:2021-06-21 00:27:08
【问题描述】:
是否有一个选项可以从 @hydra.main 装饰器下的函数中获取配置对象作为字典?
我尝试过这样的事情,但它返回 None
@hydra.main(config_path="conf", config_name="config")
def my_app(cfg) -> dict:
print(cfg) # --> work, the cfg object exists inside the function scope
return cfg
a = my_app()
print(a)
我知道我可以使用compose API,但我不想使用它,因为它的功能有限(Tab 补全、Multirun 等)
【问题讨论】: