projects
/
agtree2dot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Changed the font and node colors.
[agtree2dot.git]
/
agtree2dot.py
diff --git
a/agtree2dot.py
b/agtree2dot.py
index
8cc9e8c
..
0f787ac
100755
(executable)
--- a/
agtree2dot.py
+++ b/
agtree2dot.py
@@
-103,20
+103,24
@@
def fill_graph_lists(u, node_labels, node_list, link_list):
def print_dot(node_list, link_list, out):
out.write('digraph{\n')
def print_dot(node_list, link_list, out):
out.write('digraph{\n')
+ out.write(' graph [fontname = "helvetica"];\n')
+ out.write(' node [fontname = "helvetica"];\n')
+ out.write(' edge [fontname = "helvetica"];\n')
+
for n in node_list:
node = node_list[n]
if isinstance(n, torch.autograd.Variable):
out.write(
' ' + \
for n in node_list:
node = node_list[n]
if isinstance(n, torch.autograd.Variable):
out.write(
' ' + \
- str(node.id) + ' [shape=note,label="' + \
+ str(node.id) + ' [shape=note,
style=filled, fillcolor="#e0e0ff",
label="' + \
node.label + ' ' + re.search('torch\.Size\((.*)\)', str(n.data.size())).group(1) + \
'"]\n'
)
else:
out.write(
' ' + \
node.label + ' ' + re.search('torch\.Size\((.*)\)', str(n.data.size())).group(1) + \
'"]\n'
)
else:
out.write(
' ' + \
- str(node.id) + ' [shape=record,label="{ ' + \
+ str(node.id) + ' [shape=record,
style=filled, fillcolor="#f0f0f0",
label="{ ' + \
slot_string(node.max_out, for_input = True) + \
node.label + \
slot_string(node.max_in, for_input = False) + \
slot_string(node.max_out, for_input = True) + \
node.label + \
slot_string(node.max_in, for_input = False) + \