提交 e146275a authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Remove the "mode" argument of pydotprint.

It does not really make sense to specify something else than the default.
上级 fbc0927d
...@@ -374,15 +374,13 @@ pp = pprint ...@@ -374,15 +374,13 @@ pp = pprint
def pydotprint(fct, outfile=None, def pydotprint(fct, outfile=None,
compact=True, mode=None, format='png', with_ids=False): compact=True, format='png', with_ids=False):
""" """
print to a file in png format the graph of op of a compile theano fct. print to a file in png format the graph of op of a compile theano fct.
:param fct: the theano fct returned by theano.function. :param fct: the theano fct returned by theano.function.
:param outfile: the output file where to put the graph. :param outfile: the output file where to put the graph.
:param compact: if True, will remove intermediate var that don't have name. :param compact: if True, will remove intermediate var that don't have name.
:param mode: if a ProfileMode, add to each Apply label (s in apply,% in apply in total op time, % in fct time)
Otherwise ignore it
:param format: the file format of the output. :param format: the file format of the output.
In the graph, box are an Apply Node(the execution of an op) and ellipse are variable. In the graph, box are an Apply Node(the execution of an op) and ellipse are variable.
...@@ -400,10 +398,9 @@ def pydotprint(fct, outfile=None, ...@@ -400,10 +398,9 @@ def pydotprint(fct, outfile=None,
if outfile is None: if outfile is None:
outfile = os.path.join(config.compiledir,'theano.pydotprint.' + outfile = os.path.join(config.compiledir,'theano.pydotprint.' +
config.device + '.' + format) config.device + '.' + format)
if mode is None:
mode = fct.maker.mode mode = fct.maker.mode
if not isinstance(mode,ProfileMode) or not mode.fct_call.has_key(fct): if not isinstance(mode,ProfileMode) or not mode.fct_call.has_key(fct):
mode=None mode = None
try: try:
import pydot as pd import pydot as pd
except: except:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论