How to save Pyrorch Model Configurations?

How can i save the pytorch model configuration in config.yml file?
I need output as shown in attached photo.