dgl.ops.gsddmm
- dgl.ops.gsddmm(g, op, lhs_data, rhs_data, lhs_target='u', rhs_target='v')[source]
广义采样-密集-密集矩阵乘法接口。 它通过
op
lhs特征和rhs特征计算边缘特征。\[x_{e} = \phi(x_{lhs}, x_{rhs}), \forall (u,e,v)\in \mathcal{G}\]其中 \(x_{e}\) 是返回的边特征,\(x_u\), \(x_v\) 分别指代
u
,v
。 \(\phi\) 是二元运算符op
,而 \(\mathcal{G}\) 是我们应用 gsddmm 的图:g
。 \(lhs\) 和 \(rhs\) 是 \(u,v,e\) 中的一个。- Parameters:
g (DGLGraph) – The input graph.
op (str) – 二元运算符,可以是
add
,sub
,mul
,div
,dot
,copy_lhs
,copy_rhs
.lhs_data (tensor 或 None) – 左操作数,如果操作不需要它,则可以为 None。
rhs_data (tensor 或 None) – 右操作数,如果操作不需要,则可以为 None。
lhs_target (str) – 选择 ``u``(源), ``e``(边) 或 ``v``(目标) 作为左操作数。
rhs_target (str) – 选择 ``u``(源), ``e``(边) 或 ``v``(目标) 作为右操作数。
- Returns:
结果张量。
- Return type:
张量