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
8e2e68df
"git@developer.sourcefind.cn:OpenDAS/pytorch-encoding.git" did not exist on "c959dab8312b637fcc7edce83607acb4b0f82645"
Commit
8e2e68df
authored
Jun 15, 2018
by
Minjie Wang
Browse files
fix bugs for topdown.py models
parent
6858ed54
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
python/dgl/graph.py
python/dgl/graph.py
+5
-3
No files found.
python/dgl/graph.py
View file @
8e2e68df
...
...
@@ -159,7 +159,7 @@ class DGLGraph(DiGraph):
"""
self
.
readout_func
=
readout_func
def
readout
(
self
,
nodes
=
'all'
,
edges
=
'all'
):
def
readout
(
self
,
nodes
=
'all'
,
edges
=
'all'
,
**
kwargs
):
"""Trigger the readout function on the specified nodes/edges.
Parameters
...
...
@@ -168,15 +168,17 @@ class DGLGraph(DiGraph):
The nodes to get reprs from.
edges : str, pair of nodes, pair of containers or pair of tensors
The edges to get reprs from.
kwargs : keyword arguments, optional
Arguments for the readout function.
"""
nodes
=
self
.
_nodes_or_all
(
nodes
)
edges
=
self
.
_
nod
es_or_all
(
nod
es
)
edges
=
self
.
_
edg
es_or_all
(
edg
es
)
assert
self
.
readout_func
is
not
None
,
\
"Readout function is not registered."
# TODO(minjie): tensorize following loop.
nstates
=
[
self
.
nodes
[
n
]
for
n
in
nodes
]
estates
=
[
self
.
edges
[
e
]
for
e
in
edges
]
return
self
.
readout_func
(
nstates
,
estates
)
return
self
.
readout_func
(
nstates
,
estates
,
**
kwargs
)
def
sendto
(
self
,
u
,
v
):
"""Trigger the message function on edge u->v
...
...
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