Thanks for your response Frank. I tried your approach, but it didn’t work for my case.
Instead of the mean computation below, I want the geom.
        model_dict[k] = th.stack([h_models[i].state_dict()[k].float()*(n*h_lens[i]/total) for i in range(len(h_models))], 0).mean(0)```

code source: (https://towardsdatascience.com/preserving-data-privacy-in-deep-learning-part-3-ae2103c40c22)