Hi,
I have seen a similar question in this post.
I also want to concat node and edge features. However, I need to feed the result to a single reducer function.
For example, Zihao gives a solution which is
g.update_all([fn.copy_e('e', 'm_e'), fn.copy_u('h', 'm_n')],
[fn.sum('m_e', 'h_e'), fn.sum('m_n', 'h_n')])
What I want is:
graph.update_all([fn.copy_e('e', 'm_e'), fn.copy_u('h', 'm_n')], self._lstm_reducer)
# my lstm reducer
def _lstm_reducer(self, nodes):
m_n = nodes.mailbox['m_n'] # (B, L, D)
m_e = nodes.mailbox['m_e']
rst = self.lstm(tf.concat([m_n, m_e], axis=-1))
return {'neigh': rst}
where I expect the _lstm_reducer
to concat m_e
and m_n
. However, I got a error “‘list’ object is not callable”. What is a good way to do this?
Thanks!