(num_rows, dtype=tf.float32)
| 29 | |
| 30 | |
| 31 | def _sparse_eye(num_rows, dtype=tf.float32): |
| 32 | return tf.SparseTensor( |
| 33 | tf.stack([tf.range(num_rows)] * 2, axis=1), |
| 34 | tf.ones(num_rows, dtype), tf.stack([num_rows] * 2)) |
| 35 | |
| 36 | |
| 37 | class GCNAggregator(layers.Layer): |