g.send_and_recv(g.edges())
updates only the nodes with incoming edges and equals
def has_incoming_edges(node_batch):
"""Find nodes with incoming edges.
Parameters
---------------
node_batch : Instance representing a batch of nodes,
see the documentation for NodeBatch
(https://docs.dgl.ai/api/python/udf.html#nodebatch).
Returns
----------
Bool Tensor
The ith element is True if node i has incoming edges
and False otherwise.
"""
return g.in_degrees(nodes.nodes()) > 0
g.send(g.edges())
g.recv(g.filter_nodes(has_incoming_edges))
while
g.recv(g.nodes())
is applied over all nodes. Since node 0 has no incoming edges, a feature initializer is called to initialize the feature. By default, it initializes a zero tensor. See dgl.init.zero_initializer.
Thank you so much!Thank you so much!