Layer-wise linear combination of two models

Thank you !

How can I determine which keys of the ‘state_dict’ dictionary belong to the same layer ?

I suppose for each key its layer name is the first part of the key name, before the last occurence of the dot character “.” in the key name string.
Is that right ?

As in the example at Saving and Loading Models — PyTorch Tutorials 1.0.0.dev20181128 documentation
and in How do I update old key name in state_dict to new version

Btw, nice greetings to California. I hope GTC 2024 is physically again, looking forward to present again at this great conference.