dgl.ops.gspmmο
- dgl.ops.gspmm(g, op, reduce_op, lhs_data, rhs_data)[source]ο
Generalized Sparse Matrix Multiplication interface. It fuses two steps into one kernel.
Computes messages by
op
source node and edge features.Aggregate the messages by
reduce_op
as the features on destination nodes.
where
is the returned feature on destination nodes, and , refers tou
,e
respectively. means binary operatorop
and means reduce operatorreduce_op
, is the graph we apply gspmm on:g
.Note that this function does not handle gradients.
- Parameters:
g (DGLGraph) β The input graph.
op (str) β The binary opβs name, could be
add
,sub
,mul
,div
,copy_lhs
,copy_rhs
.reduce_op (str) β Reduce operator, could be
sum
,max
,min
,mean
.lhs_data (tensor or None) β The left operand, could be None if itβs not required by the op.
rhs_data (tensor or None) β The right operand, could be None if itβs not required by the op.
- Returns:
The result tensor.
- Return type:
tensor