Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dgl
Commits
45e3e9af
Unverified
Commit
45e3e9af
authored
Nov 19, 2020
by
Mufei Li
Committed by
GitHub
Nov 19, 2020
Browse files
[WIP] Misc Fix (#2359)
* Update * Update * Update
parent
b0a9d16f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
5 deletions
+7
-5
docs/source/api/python/dgl.function.rst
docs/source/api/python/dgl.function.rst
+0
-3
docs/source/guide/message-api.rst
docs/source/guide/message-api.rst
+2
-0
docs/source/guide_cn/message-api.rst
docs/source/guide_cn/message-api.rst
+2
-0
python/dgl/nn/pytorch/conv/nnconv.py
python/dgl/nn/pytorch/conv/nnconv.py
+3
-2
No files found.
docs/source/api/python/dgl.function.rst
View file @
45e3e9af
...
@@ -112,8 +112,6 @@ Here is a cheatsheet of all the DGL built-in functions.
...
@@ -112,8 +112,6 @@ Here is a cheatsheet of all the DGL built-in functions.
| +-----------------------------------------------------------------+-----------------------+
| +-----------------------------------------------------------------+-----------------------+
| | ``sum`` | |
| | ``sum`` | |
| +-----------------------------------------------------------------+-----------------------+
| +-----------------------------------------------------------------+-----------------------+
| | ``prod`` | |
| +-----------------------------------------------------------------+-----------------------+
| | ``mean`` | |
| | ``mean`` | |
+-------------------------+-----------------------------------------------------------------+-----------------------+
+-------------------------+-----------------------------------------------------------------+-----------------------+
...
@@ -168,5 +166,4 @@ Reduce functions
...
@@ -168,5 +166,4 @@ Reduce functions
sum
sum
max
max
min
min
prod
mean
mean
docs/source/guide/message-api.rst
View file @
45e3e9af
...
@@ -58,6 +58,8 @@ to the Reduce UDF that sums up the message ``m``:
...
@@ -58,6 +58,8 @@ to the Reduce UDF that sums up the message ``m``:
def reduce_func(nodes):
def reduce_func(nodes):
return {'h': torch.sum(nodes.mailbox['m'], dim=1)}
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`
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
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:
for parameter and by default updates the features of all edges. For example:
...
...
docs/source/guide_cn/message-api.rst
View file @
45e3e9af
...
@@ -43,6 +43,8 @@ DGL支持内置的聚合函数 ``sum``、 ``max``、 ``min`` 和 ``mean`` 操作
...
@@ -43,6 +43,8 @@ DGL支持内置的聚合函数 ``sum``、 ``max``、 ``min`` 和 ``mean`` 操作
def reduce_func(nodes):
def reduce_func(nodes):
return {'h': torch.sum(nodes.mailbox['m'], dim=1)}
return {'h': torch.sum(nodes.mailbox['m'], dim=1)}
关于用户定义函数的进阶用法,参见 :ref:`apiudf`。
在DGL中,也可以在不涉及消息传递的情况下,通过 :meth:`~dgl.DGLGraph.apply_edges` 单独调用逐边计算。
在DGL中,也可以在不涉及消息传递的情况下,通过 :meth:`~dgl.DGLGraph.apply_edges` 单独调用逐边计算。
:meth:`~dgl.DGLGraph.apply_edges` 的参数是一个消息函数。并且在默认情况下,这个接口将更新所有的边。例如:
:meth:`~dgl.DGLGraph.apply_edges` 的参数是一个消息函数。并且在默认情况下,这个接口将更新所有的边。例如:
...
...
python/dgl/nn/pytorch/conv/nnconv.py
View file @
45e3e9af
...
@@ -151,8 +151,9 @@ class NNConv(nn.Module):
...
@@ -151,8 +151,9 @@ class NNConv(nn.Module):
is the number of nodes of the graph and :math:`D_{in}` is the
is the number of nodes of the graph and :math:`D_{in}` is the
input feature size.
input feature size.
efeat : torch.Tensor
efeat : torch.Tensor
The edge feature of shape :math:`(N, *)`, should fit the input
The edge feature of shape :math:`(E, *)`, which should fit the input
shape requirement of ``edge_func``.
shape requirement of ``edge_func``. :math:`E` is the number of edges
of the graph.
Returns
Returns
-------
-------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment