dgl.ops.gsddmm

dgl.ops.gsddmm(g, op, lhs_data, rhs_data, lhs_target='u', rhs_target='v')[source]

广义采样稠密稠密矩阵乘法接口。它通过对 lhs 特征和 rhs 特征应用 op 操作来计算边特征。

\[x_{e} = \phi(x_{lhs}, x_{rhs}), \forall (u,e,v)\in \mathcal{G}\]

其中 \(x_{e}\) 是返回的边特征,\(x_u\)\(x_v\) 分别指代 uv\(\phi\) 是二元操作符 op\(\mathcal{G}\) 是我们应用 gsddmm 的图:g\(lhs\)\(rhs\)\(u,v,e\) 中的一个。

参数:
  • g (DGLGraph) – 输入图。

  • op (str) – 二元操作符,可以是 add, sub, mul, div, dot, copy_lhs, copy_rhs 中的一个。

  • lhs_data (tensor or None) – 左操作数,如果操作符不需要,可以为 None。

  • rhs_data (tensor or None) – 右操作数,如果操作符不需要,可以为 None。

  • lhs_target (str) – 左操作数的来源选择:``u`` (源节点), ``e`` (边) 或 ``v`` (目标节点)。

  • rhs_target (str) – 右操作数的来源选择:``u`` (源节点), ``e`` (边) 或 ``v`` (目标节点)。

返回值:

结果张量。

返回类型:

张量