e3bac70b4fe620bd2b540235136a9d1dad436ab6,python/dgl/graph.py,DGLGraph,_batch_sendto,#DGLGraph#Any#Any#Any#,444
Before Change
u = utils.convert_to_id_tensor(u)
v = utils.convert_to_id_tensor(v)
eid = self.cached_graph.get_edge_id(u, v)
self.msg_graph.add_edges(u, v)
if len(u) != len(v) and len(u) == 1:
u = F.broadcast_to(u, v)
// call UDF
src_reprs = self.get_n_repr(u)
After Change
def _batch_sendto(self, u, v, message_func):
f_msg = _get_message_func(message_func)
if is_all(u) and is_all(v):
u, v = self.cached_graph.edges()
self.msg_graph.add_edges(u, v)
// call UDF
src_reprs = self.get_n_repr(u)
edge_reprs = self.get_e_repr()
msgs = message_func(src_reprs, edge_reprs)
else:
u = utils.convert_to_id_tensor(u)
v = utils.convert_to_id_tensor(v)
u, v = utils.edge_broadcasting(u, v)
eid = self.cached_graph.get_edge_id(u, v)
self.msg_graph.add_edges(u, v)
// call UDF
src_reprs = self.get_n_repr(u)
edge_reprs = self.get_e_repr_by_id(eid)
msgs = message_func(src_reprs, edge_reprs)
if isinstance(msgs, dict):
self._msg_frame.append(msgs)
else:
self._msg_frame.append({__MSG__ : msgs})
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances
Project Name: dmlc/dgl
Commit Name: e3bac70b4fe620bd2b540235136a9d1dad436ab6
Time: 2018-08-12
Author: minjie.wang@nyu.edu
File Name: python/dgl/graph.py
Class Name: DGLGraph
Method Name: _batch_sendto
Project Name: dmlc/dgl
Commit Name: 4ea42e3e0888508a4a9a605777e39533ff5a2e65
Time: 2019-04-05
Author: zhengda1936@gmail.com
File Name: examples/mxnet/gcn/train.py
Class Name:
Method Name: main
Project Name: dmlc/dgl
Commit Name: 4ea42e3e0888508a4a9a605777e39533ff5a2e65
Time: 2019-04-05
Author: zhengda1936@gmail.com
File Name: examples/pytorch/gcn/train.py
Class Name:
Method Name: main