Is there a way to do this del call on the parameters dynamically, without having to write the nested object name nn.module.weight?
Example: Say the module has N total parameter sets, and I want to delete all of them, and cannot know what they will be named pre run, because I am writing a general wrapper for any torch.nn.Module.
I do not mind reading the names at runtime and dealing with those, but I just cannot write less general code with their names explicitly typed out.
For recursive set and get, this stackoverflow post 8 was helpful, and also I could use the .children() or .modules() functions. But I am stuck on deletion.
Thanks!