Share weights within the model in dynamic way

I’m trying to deploy the following model in PyTorch.

Consider the right part of the network. I have data related to each station from 1 to K where K is dynamic. layers on the right should share weights for all stations.

Can someone tell me how can I share weights for this kind of application?