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
ca0622b2
"git@developer.sourcefind.cn:OpenDAS/dgl.git" did not exist on "1ad78fba619ab61e6720270ce65fdb6791b233c1"
Commit
ca0622b2
authored
May 11, 2018
by
zzhang-cn
Browse files
add visualization of the tree
parent
40c698dd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
graph.py
graph.py
+6
-0
No files found.
graph.py
View file @
ca0622b2
...
@@ -116,6 +116,12 @@ class DiGraph(NN.Module):
...
@@ -116,6 +116,12 @@ class DiGraph(NN.Module):
'''
'''
self
.
update_funcs
.
append
((
self
.
_nodes_or_all
(
nodes
),
update_func
,
batched
))
self
.
update_funcs
.
append
((
self
.
_nodes_or_all
(
nodes
),
update_func
,
batched
))
def
draw
(
self
):
from
networkx.drawing.nx_agraph
import
graphviz_layout
pos
=
graphviz_layout
(
self
.
G
,
prog
=
'dot'
)
nx
.
draw
(
self
.
G
,
pos
,
with_labels
=
True
)
def
step
(
self
):
def
step
(
self
):
# update message
# update message
for
ebunch
,
f
,
batched
in
self
.
message_funcs
:
for
ebunch
,
f
,
batched
in
self
.
message_funcs
:
...
...
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