提交 1b377a31 authored 作者: Claude Coulombe's avatar Claude Coulombe

Small visual changes (blue color)

I’ve added the key ‘Output’ to the dict colorCodes in order to be able to changes the ‘blue’ color of Theano graph node which is not well visible. Personally, I used the 'Output': '#87CEFA' color code calling pydotprint(…). An alternative correction should be to replace ‘blue’ by '#87CEFA’. It’s up to you…
上级 15c90dd3
...@@ -586,8 +586,8 @@ default_colorCodes = {'GpuFromHost': 'red', ...@@ -586,8 +586,8 @@ default_colorCodes = {'GpuFromHost': 'red',
'IfElse': 'magenta', 'IfElse': 'magenta',
'Elemwise': '#FFAABB', # dark pink 'Elemwise': '#FFAABB', # dark pink
'Subtensor': '#FFAAFF', # purple 'Subtensor': '#FFAAFF', # purple
'Alloc': '#FFAA22'} # orange 'Alloc': '#FFAA22', # orange
'Output': 'blue' }
def pydotprint(fct, outfile=None, def pydotprint(fct, outfile=None,
compact=True, format='png', with_ids=False, compact=True, format='png', with_ids=False,
...@@ -889,7 +889,7 @@ def pydotprint(fct, outfile=None, ...@@ -889,7 +889,7 @@ def pydotprint(fct, outfile=None,
param['label'] = label param['label'] = label
if hasattr(node.op, 'view_map') and idx in reduce( if hasattr(node.op, 'view_map') and idx in reduce(
list.__add__, node.op.view_map.values(), []): list.__add__, node.op.view_map.values(), []):
param['color'] = 'blue' param['color'] = colorCodes['Output']
elif hasattr(node.op, 'destroy_map') and idx in reduce( elif hasattr(node.op, 'destroy_map') and idx in reduce(
list.__add__, node.op.destroy_map.values(), []): list.__add__, node.op.destroy_map.values(), []):
param['color'] = 'red' param['color'] = 'red'
...@@ -939,9 +939,9 @@ def pydotprint(fct, outfile=None, ...@@ -939,9 +939,9 @@ def pydotprint(fct, outfile=None,
if high_contrast: if high_contrast:
g.add_node(pd.Node(varid, style='filled', g.add_node(pd.Node(varid, style='filled',
label=varstr, label=varstr,
fillcolor='blue', shape=var_shape)) fillcolor=colorCodes['Output'], shape=var_shape))
else: else:
g.add_node(pd.Node(varid, color='blue', g.add_node(pd.Node(varid, color=colorCodes['Output'],
label=varstr, label=varstr,
shape=var_shape)) shape=var_shape))
elif len(var.clients) == 0: elif len(var.clients) == 0:
...@@ -971,7 +971,7 @@ def pydotprint(fct, outfile=None, ...@@ -971,7 +971,7 @@ def pydotprint(fct, outfile=None,
for sha, up in input_update.items(): for sha, up in input_update.items():
_, shaid = var_name(sha) _, shaid = var_name(sha)
_, upid = var_name(up) _, upid = var_name(up)
g.add_edge(pd.Edge(shaid, upid, label="UPDATE", color="blue")) g.add_edge(pd.Edge(shaid, upid, label="UPDATE", color=colorCodes['Output']))
if cond_highlight: if cond_highlight:
g.add_subgraph(c1) g.add_subgraph(c1)
...@@ -1135,7 +1135,7 @@ def pydotprint_variables(vars, ...@@ -1135,7 +1135,7 @@ def pydotprint_variables(vars,
my_list[nd] = varastr my_list[nd] = varastr
color = None color = None
if nd in vars: if nd in vars:
color = 'blue' color = colorCodes['Output']
elif nd in orphanes: elif nd in orphanes:
color = 'gray' color = 'gray'
if color is None: if color is None:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论