I’m reading the docs comprehensively and now I have a question. Is it correct that I want to use a layer in the reduce_func ?
For example, if I want to use a nn.linear to alter a message , I might define the linear layer in init funciton. and the following might be like:
def reduce_func(self,nodes):
return {'feat': self.emb(nodes.data['h'],nodes.mailbox['m'])} # self.emb denotes a nn.linear() or some other layers
def def forward(self, g, h):
funcs = dict()
for c_etype in g.canonical_etypes:
#srctype, etype, dsttype = c_etype
#print(c_etype)
funcs[c_etype] = (fn.v_sub_u('hv', 'hu', 'm'), self.reduce_func)
g.multi_update_all(funcs, 'sum')
I am curious about this mindless thought and I’d appreciate any advice!