MCPcopy Create free account
hub / github.com/IBM/Project_CodeNet / forward

Method forward

model-experiments/gnn-based-experiments/src/model/gnn.py:77–95  ·  view source on GitHub ↗

Return: A list of predictions. i-th element represents prediction at i-th position of the sequence.

(self, batched_data)

Source from the content-addressed store, hash-verified

75
76
77 def forward(self, batched_data):
78 '''
79 Return:
80 A list of predictions.
81 i-th element represents prediction at i-th position of the sequence.
82 '''
83
84 h_node = self.gnn_node(batched_data)
85
86 h_graph = self.pool(h_node, batched_data.batch)
87
88 if self.num_class > 0:
89 return self.graph_pred_linear(h_graph)
90
91 pred_list = []
92 for i in range(self.max_seq_len):
93 pred_list.append(self.graph_pred_linear_list[i](h_graph))
94
95 return pred_list
96
97if __name__ == '__main__':
98 pass

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected