Multiple reduce functions


I’d like to use different reduce functions based on the node type.
For example, if the node’s type is A, then sum incoming vectors from edges and multiply it with matrix W_a, and if the node’s type is B, then multiply sum with matrix W_b.
So, can you give me some advice, what is an efficient way to do this?
I know, that I can iterate over NodeBatch and choose this matrix individually, but this will kill all batching…

Hi @SpirinEgor, I think your use case is the same as RGCN’s, DGL supports heterogeneous graph where you can do multi-type message passing synchronously.

Please refer the heterogeneous graph tutorial and see how RGCN is implemented: