Support initial node features in RGCN


Hi all,
The example code for RGCN assumes that there are no initial features for each node, thus they made an “embedding lookup” on weights matrix, see the following code (line 86 of )

        if self.is_input_layer:
            def msg_func(edges):
                # for input layer, matrix multiply can be converted to be
                # an embedding lookup using source node id
                embed = weight.view(-1, self.out_feat)
                index =['type'] * self.in_feat + edges.src['id']
                return {'msg': embed.index_select(0, index) *['norm']}

However, in my case, I have the initial features for each node, how to modify the code to fit that?


You can use g.ndata['feat']=th.tensor(...) to set initial feature for nodes