// Convolution via sparse row sum. Converts [|E| x M_out] feature matrix to
// [n x M_out] feature matrix.
size = torch.Size([adj.size(0), adj.size(1), output.size(1)])
adj = torch.sparse.FloatTensor(indices, output, size)
output = sum(adj, dim=1)
// TODO: root node and weight mean
// root_weight = weight[torch.arange(kernel_size[-1])]
After Change
// Weighten root node features by multiplying with the meaned weights at the
// origin.
index = torch.arange(0, kernel_size[-1]).long()
root_weight = weight[index].mean(0)
output += torch.mm(features, root_weight)
if bias is not None:
output += bias