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

Method call

tf_euler/python/utils/encoders.py:895–922  ·  view source on GitHub ↗
(self, inputs)

Source from the content-addressed store, hash-verified

893 self.nb_num = nb_num
894
895 def call(self, inputs):
896 batch_size = tf.shape(inputs)[0]
897 neighbors = euler_ops.sample_neighbor(
898 inputs, self.edge_type, self.nb_num)[0]
899 node_feats = euler_ops.get_dense_feature(
900 tf.reshape(inputs, [-1]),
901 [self.feature_idx],
902 [self.feature_dim])[0]
903 neighbor_feats = euler_ops.get_dense_feature(
904 tf.reshape(neighbors, [-1]),
905 [self.feature_idx],
906 [self.feature_dim])[0]
907 node_feats = tf.reshape(node_feats, [batch_size, 1, self.feature_dim])
908 neighbor_feats = tf.reshape(
909 neighbor_feats, [batch_size, self.nb_num, self.feature_dim])
910 nbs = tf.concat([node_feats, neighbor_feats], 1)
911 topk, _ = tf.nn.top_k(tf.transpose(neighbor_feats, [0, 2, 1]),
912 k=self.k)
913 topk = tf.transpose(topk, [0, 2, 1])
914 topk = tf.concat([node_feats, topk], 1)
915 hidden = tf.layers.conv1d(topk,
916 self.hidden_dim,
917 self.k // 2 + 1, use_bias=True)
918 out = tf.layers.conv1d(hidden,
919 self.out_dim,
920 self.k // 2 + 1, use_bias=True)
921 out = tf.slice(out, [0, 0, 0], [batch_size, 1, self.out_dim])
922 return tf.reshape(out, [batch_size, self.out_dim])

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected