Users should not make assumption in the batch dimension

In the API reference for “user-defined function related data structures”, you write

“Note: the size of the batch dimension is determined by the DGL framework for good efficiency and small memory footprint. Users should not make assumption in the batch dimension.”

This makes me very nervous, because it sounds like we never know what to expect the input to look like when writing the Edge UDF or Node UDF . For example, in the Karate tutorial with GCN, you use torch.sum(nodes.mailbox['msg'], dim=1) . Your quote above makes it sound like we need to choose the dimension of summation (dim=1) on a case-by-case basis.

Could you please elaborate on what is constant whenever a node/edge UDF is called?

Thanks!

The answer is here:

3 Likes