"examples/vscode:/vscode.git/clone" did not exist on "2dd06b21529d77fa398706444f6db080378e8a79"
message-part.rst 589 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
.. _guide-message-passing-part:

2.3 Apply Message Passing On Part Of The Graph
----------------------------------------------

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 :meth:`~dgl.DGLGraph.update_all` on the
subgraph. For example:

.. code::

    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 :ref:`guide-minibatch` for more detailed
usages.