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.

xe=ฯ•(xlhs,xrhs),โˆ€(u,e,v)โˆˆG

where xe is the returned feature on edges and xu, xv refers to u, v respectively. ฯ• is the binary operator op, and 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