Sharing weights between two RGCNs

Hello, first of all thank you for the wonderful library. I am a beginner when it comes to machine learning on graphs, so my question might seem a bit naive.
Assume there is a directed, attributed graph G, and it contains 2 nodes A and B, which induces 2 subgraphs- SG_A and SG_B in the graph G. I want to find the embedding of the subgraphs SG_A and SG_B using a RGCN. My initial idea was to train a RGCN for each subgraph and share the weights between them. However, I don’t understand how to do it with DGL? Do you have any pointers for this? Or any suggestions how to do it?

Thank you very much in advance.

Hi @sbhttchryy, what do you mean by “train a RGCN for each subgraph and share the weights between them”, why don’t you use the same RGCN for each subgraph?

btw, sharing weights between DGL nn modules is the same as sharing weights in PyTorch nn modules.