Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 641 Bytes

message-part.rst

File metadata and controls

20 lines (14 loc) · 641 Bytes

2.3 Apply Message Passing On Part Of The Graph

(中文版) <guide_cn-message-passing-part>

If one only wants to update part of the nodes in the graph, the practice is to create a subgraph by providing the IDs for the nodes to include in the update, then call ~dgl.DGLGraph.update_all on the subgraph. For example:

nid = [0, 2, 3, 6, 7, 9]
sg = g.subgraph(nid)
sg.update_all(message_func, reduce_func, apply_node_func)

This is a common usage in mini-batch training. Check guide-minibatch for more detailed usages.