dgl.function.e_mul_vΒΆ

dgl.function.e_mul_v(lhs_field, rhs_field, out)ΒΆ

Builtin message function that computes a message on an edge by performing element-wise mul between features of e and v if the features have the same shape; otherwise, it first broadcasts the features to a new shape and performs the element-wise operation.

Broadcasting follows NumPy semantics. Please see https://docs.scipy.org/doc/numpy/user/basics.broadcasting.html for more details about the NumPy broadcasting semantics.

Parameters
  • lhs_field (str) – The feature field of e.

  • rhs_field (str) – The feature field of v.

  • out (str) – The output message field.

Examples

>>> import dgl
>>> message_func = dgl.function.e_mul_v('h', 'h', 'm')