(self, x, edge_index, size=None, **kwargs)
| 30 | self.build = False |
| 31 | |
| 32 | def __call__(self, x, edge_index, size=None, **kwargs): |
| 33 | if not self.build: |
| 34 | self.build = True |
| 35 | self.beta = tf.Variable([1.], name='beta', dtype=tf.float32) |
| 36 | norm = \ |
| 37 | [tf.nn.l2_normalize(x[0], axis=-1) if x[0] is not None else None, |
| 38 | tf.nn.l2_normalize(x[1], axis=-1) if x[1] is not None else None] |
| 39 | gather_x, gather_norm, = self.gather_feature([x, norm], edge_index) |
| 40 | out = self.apply_edge(edge_index[0], |
| 41 | gather_x[1], |
| 42 | gather_norm[0], |
| 43 | gather_norm[1], |
| 44 | size[0]) |
| 45 | out = mp_ops.scatter_(self.aggr, out, edge_index[0], size=size[0]) |
| 46 | out = self.apply_node(out) |
| 47 | return out |
| 48 | |
| 49 | def apply_edge(self, edge_index_i, x_j, norm_i, norm_j, num_nodes): |
| 50 | alpha = tf.reduce_sum(self.beta * (norm_i * norm_j), |
nothing calls this directly
no test coverage detected