dgl.ops.u_add_e_mean

dgl.ops.u_add_e_mean(g, x, y)

广义SpMM函数。 它将两个步骤融合到一个内核中。

  1. 通过添加源节点和边特征来计算消息。

  2. 通过均值聚合消息作为目标节点的特征。

Parameters:
  • g (DGLGraph) – The input graph

  • x (tensor) – The source node features.

  • y (tensor) – The edge features.

Returns:

结果张量。

Return type:

张量

注释

此函数支持自动求导(根据输出梯度计算输入梯度)。如果两个输入操作数的特征形状不匹配,我们首先将特征广播到统一的形状(注意内存使用不会相应增加),然后执行操作。

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

对于没有传入消息的节点,mean函数将返回零。