(self, inputs, samples, shuffle)
| 514 | return tf.split(shuffle_res, [tf.shape(v)[0] for v in inputs], 0) |
| 515 | |
| 516 | def agg(self, inputs, samples, shuffle): |
| 517 | hidden = [self.node_encoder(sample) for sample in samples] |
| 518 | if shuffle: |
| 519 | hidden = self.shuffle_tensors(hidden) |
| 520 | for layer in range(self.num_layers): |
| 521 | aggregator = self.aggregators[layer] |
| 522 | next_hidden = [] |
| 523 | for hop in range(self.num_layers - layer): |
| 524 | neigh_shape = [-1, self.fanouts[hop], self.dims[layer]] |
| 525 | h = aggregator((hidden[hop], |
| 526 | tf.reshape(hidden[hop + 1], |
| 527 | neigh_shape))) |
| 528 | next_hidden.append(h) |
| 529 | hidden = next_hidden |
| 530 | output_shape = inputs.shape.concatenate(self.dims[-1]) |
| 531 | output_shape = [d if d is not None else -1 |
| 532 | for d in output_shape.as_list()] |
| 533 | return tf.reshape(hidden[0], output_shape) |
| 534 | |
| 535 | def call(self, inputs): |
| 536 | samples = euler_ops.sample_fanout( |
no test coverage detected