I instantiate a hydra configuration from a python dataclass. For example
from dataclasses import dataclassfrom typing import Anyfrom hydra.utils import instantiateclass Model(): def __init__(self, x=1): self.x = x@dataclassclass MyConfig: model: Any param: intstatic_config = MyConfig(model=Model(x=2), param='whatever')instantiated_config = instantiate(static_config)
Now, I would like to dump this configuration as a yaml, including the _target_
fields that Hydra uses to re-instantiate the objects pointed to inside the configuration. I would like to avoid having to write my own logic to write those _target_
fields, and I imagine there must be some hydra utility that does this, but I can't seem to find it in the documentation.