Skip to content

Default value for a regular config key #2594

Answered by omry
dagap asked this question in Q&A
Discussion options

You must be logged in to vote

Check the OmegaConf select resolver documented here.

cfg = OmegaConf.create({
 "a": "Saving output to ${oc.select:output,/tmp}"
})
print(cfg.a)
# Saving output to /tmp
cfg.output = "/etc/config"
print(cfg.a)
# Saving output to /etc/config

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by dagap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants