Skip to content

Add OR Override-if-exists #1049

@tkornuta-nvidia

Description

@tkornuta-nvidia

🚀 Feature Request

Add option to "Add-OR-Override-if-exists" to command line params

e.g.

python myscript.py !gpus=2 # gpus will be set to two, disregarding whether it existed in the original config file or not

Motivation

Hydra offers few options to handle params from command line:

python myscript.py gpus=2 # override gpus (must exists in config files/structured config earlier!)
python myscript.py ~gpus # removes gpus from configuration 
python myscript.py +gpus=2 # add gpus (cannot exists in config files/structured config earlier!)

Note +gpus will raise an error if it was already present in the configuration.

So the case, when we want to have gpus set to 2, disregarding whether it was present in yaml file or now, is missing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions