dgl.function.src_mul_edge

dgl.function.src_mul_edge(src, edge, out)[source]

Builtin message function that computes message by multiplying source node features with edge features.

Parameters:
  • src (str) – The source feature field.
  • edge (str) – The edge feature field.
  • out (str) – The output message field.

Examples

>>> import dgl
>>> message_func = dgl.function.src_mul_edge(src='h', edge='w', out='m')

The above example is equivalent to the following user defined function:

>>> def message_func(edges):
>>>   return {'m': edges.src['h'] * edges.data['w']}