dgl.function.u_dot_v

dgl.function.u_dot_v(lhs_field, rhs_field, out)

内置的消息函数,通过在u和v的特征之间执行元素级别的点积来计算边上的消息 如果特征具有相同的形状;否则,它首先将特征广播到一个新的形状并执行元素级别的操作。

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 u.

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

  • out (str) – The output message field.

示例

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