MCPcopy Create free account
hub / github.com/alibaba/euler / __call__

Method __call__

tf_euler/python/mp_utils/group_gnn.py:83–109  ·  view source on GitHub ↗
(self, group_n_id)

Source from the content-addressed store, hash-verified

81 return conv(inputs, edge_index, size=size, edge_attr=edge_attr, edge_weight=edge_weight)
82
83 def __call__(self, group_n_id):
84 group_x = []
85 for sampler, n_id in zip(self.group_sampler, group_n_id):
86 data_flow = sampler(n_id)
87 num_layers = len(self.convs)
88 x = self.to_x(data_flow[0].n_id)
89 for i, conv, block in zip(range(num_layers), self.convs, data_flow):
90 if block.e_id is None:
91 edge_attr = None
92 else:
93 edge_attr = self.get_edge_attr(block)
94 if block.edge_weight is None:
95 edge_weight = None
96 else:
97 edge_weight = block.edge_weight
98 x_src = mp_ops.gather(x, block.res_n_id)
99 x_dst = x
100 x = self.calculate_conv(conv,
101 (x_src, x_dst),
102 block.edge_index,
103 size=block.size,
104 edge_attr=edge_attr,
105 edge_weight=edge_weight)
106 x = tf.nn.relu(x)
107 x = self.fc(x)
108 group_x.append(x)
109 return group_x
110
111class SingleGNNNet(BaseGNNNet):
112 def __init__(self, conv, flow, dims, fanouts, metapath, encoder, add_self_loops=False):

Callers

nothing calls this directly

Calls 5

to_xMethod · 0.95
get_edge_attrMethod · 0.95
calculate_convMethod · 0.95
fcMethod · 0.80
appendMethod · 0.80

Tested by

no test coverage detected