Instantiate object with optional arguments modified the original config.
my_function:
class: main.dummy
params:
first: 1
second: 10
----
def dummy(first, second):
return first + second
a = hydra.utils.instantiate(cfg.my_function)
b = hydra.utils.instantiate(cfg.my_function, second=20)
c = hydra.utils.instantiate(cfg.my_function)
Print a,b,c yields 11,21,21
print a, b, c will yield 11, 21, 11
I'm not sure if this behavior is desired or not but it's definitely not expected from the docs nor intuitive.
Hi, can you test on master?
Thanks, that fixes it. I should definitely check master branch more often before open a PR :)).
Thanks for reporting though, I am not sure I have a unit test that validates the original config is unmodified. will take a look later.