After reading a lot of code using dgl, it is indeed very simple to use, but one thing I haven’t thought about clearly is that when writing reduce_func, the length of the mailbox at each vertex is different.
def reduce_func(nodes):
return {'h': torch.sum(nodes.mailbox['m'], dim=1)}
For example, torch.sum above. If the number of adjacent vertices of each vertex is not the same, it is impossible to stack to a big tensor. How can dgl handle this problem? Using padding or sampling a minibatch of neighbor vertices? Can we specify the behavior ourselves?
Hope for your answer, thank you!