dgl.DGLGraph.send¶
-
DGLGraph.
send
(edges='__ALL__', message_func='default')[source]¶ Send messages along the given edges.
edges
can be any of the following types:int
: Specify one edge using its edge id.pair of int
: Specify one edge using its endpoints.int iterable
/tensor
: Specify multiple edges using their edge ids.pair of int iterable
/pair of tensors
: Specify multiple edges using their endpoints.
The UDF returns messages on the edges and can be later fetched in the destination node’s
mailbox
. Receiving will consume the messages. Seerecv()
for example.If multiple
send
are triggered on the same edge withoutrecv
. Messages generated by the latersend
will overwrite previous messages.Parameters: - edges (valid edges type, optional) – Edges on which to apply
message_func
. Default is sending along all the edges. - message_func (callable) – Message function on the edges. The function should be
an
Edge UDF
.
Notes
On multigraphs, if \(u\) and \(v\) are specified, then the messages will be sent along all edges between \(u\) and \(v\).
Examples