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 outfile: the output file where to put the graph.
In the graph, box are an Apply Node(the execution of an op) and elipse are variable.
If variable have name they are used as the text(if multiple var have the same name, they will be merged in the graph). Otherwise, if a constant, we print the value and finaly we print the type + an uniq number to don't have multiple var merged.
We print the op of the apply in the Apply box with a number that represent the toposort order of application of those Apply.
"""
importpydotaspd
g=pd.Dot()
defvar_name(var):
ifvar.nameisnotNone:
varstr=var.name
elifisinstance(var,gof.Constant):
varstr=str(var.data)
else:
#a var id is needed as otherwise var with the same type will be merged in the graph.