Unverified Commit 45e3e9af authored by Mufei Li's avatar Mufei Li Committed by GitHub
Browse files

[WIP] Misc Fix (#2359)

* Update

* Update

* Update
parent b0a9d16f
......@@ -112,8 +112,6 @@ Here is a cheatsheet of all the DGL built-in functions.
| +-----------------------------------------------------------------+-----------------------+
| | ``sum`` | |
| +-----------------------------------------------------------------+-----------------------+
| | ``prod`` | |
| +-----------------------------------------------------------------+-----------------------+
| | ``mean`` | |
+-------------------------+-----------------------------------------------------------------+-----------------------+
......@@ -168,5 +166,4 @@ Reduce functions
sum
max
min
prod
mean
......@@ -58,6 +58,8 @@ to the Reduce UDF that sums up the message ``m``:
def reduce_func(nodes):
return {'h': torch.sum(nodes.mailbox['m'], dim=1)}
For advanced usage of UDF, see :ref:`apiudf`.
It is also possible to invoke only edge-wise computation by :meth:`~dgl.DGLGraph.apply_edges`
without invoking message passing. :meth:`~dgl.DGLGraph.apply_edges` takes a message function
for parameter and by default updates the features of all edges. For example:
......
......@@ -43,6 +43,8 @@ DGL支持内置的聚合函数 ``sum``、 ``max``、 ``min`` 和 ``mean`` 操作
def reduce_func(nodes):
return {'h': torch.sum(nodes.mailbox['m'], dim=1)}
关于用户定义函数的进阶用法,参见 :ref:`apiudf`。
在DGL中,也可以在不涉及消息传递的情况下,通过 :meth:`~dgl.DGLGraph.apply_edges` 单独调用逐边计算。
:meth:`~dgl.DGLGraph.apply_edges` 的参数是一个消息函数。并且在默认情况下,这个接口将更新所有的边。例如:
......
......@@ -151,8 +151,9 @@ class NNConv(nn.Module):
is the number of nodes of the graph and :math:`D_{in}` is the
input feature size.
efeat : torch.Tensor
The edge feature of shape :math:`(N, *)`, should fit the input
shape requirement of ``edge_func``.
The edge feature of shape :math:`(E, *)`, which should fit the input
shape requirement of ``edge_func``. :math:`E` is the number of edges
of the graph.
Returns
-------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment