dgl.ops.gsddmmο
- dgl.ops.gsddmm(g, op, lhs_data, rhs_data, lhs_target='u', rhs_target='v')[source]ο
Generalized Sampled-Dense-Dense Matrix Multiplication interface. It computes edge features by
op
lhs features and rhs features.\[x_{e} = \phi(x_{lhs}, x_{rhs}), \forall (u,e,v)\in \mathcal{G}\]where \(x_{e}\) is the returned feature on edges and \(x_u\), \(x_v\) refers to
u
,v
respectively. \(\phi\) is the binary operatorop
, and \(\mathcal{G}\) is the graph we apply gsddmm on:g
. \(lhs\) and \(rhs\) are one of \(u,v,e\)βs.- Parameters:
g (DGLGraph) β The input graph.
op (str) β Binary operator, could be
add
,sub
,mul
,div
,dot
,copy_lhs
,copy_rhs
.lhs_data (tensor or None) β The left operand, could be None if itβs not required by op.
rhs_data (tensor or None) β The right operand, could be None if itβs not required by op.
lhs_target (str) β Choice of ``u``(source), ``e``(edge) or ``v``(destination) for left operand.
rhs_target (str) β Choice of ``u``(source), ``e``(edge) or ``v``(destination) for right operand.
- Returns:
The result tensor.
- Return type:
tensor