(self, inputs)
| 473 | return self._node_encoder(inputs) |
| 474 | |
| 475 | def call(self, inputs): |
| 476 | samples = euler_ops.sample_fanout( |
| 477 | inputs, self.metapath, self.fanouts, |
| 478 | default_node=self._max_id + 1)[0] |
| 479 | hidden = [self.node_encoder(sample) for sample in samples] |
| 480 | for layer in range(self.num_layers): |
| 481 | aggregator = self.aggregators[layer] |
| 482 | next_hidden = [] |
| 483 | for hop in range(self.num_layers - layer): |
| 484 | neigh_shape = [-1, self.fanouts[hop], self.dims[layer]] |
| 485 | h = aggregator((hidden[hop], |
| 486 | tf.reshape(hidden[hop + 1], |
| 487 | neigh_shape))) |
| 488 | next_hidden.append(h) |
| 489 | hidden = next_hidden |
| 490 | output_shape = inputs.shape.concatenate(self.dims[-1]) |
| 491 | output_shape = [d if d is not None else -1 |
| 492 | for d in output_shape.as_list()] |
| 493 | return tf.reshape(hidden[0], output_shape) |
| 494 | |
| 495 | |
| 496 | class ShuffleSageEncoder(SageEncoder): |
nothing calls this directly
no test coverage detected