Changes all occurrences of the 'env' attribute to 'fgraph', and
renames Env to FunctionGraph. Adds properties that warn about
deprecated 'env' attribute.
The current way of caching is from a hash of the generated code. That is inefficient because code has to be generated each time, which might be a costly process. Furthermore, usage of hashing in sets make it difficult to ensure a consistent ordering of Ops in graphs where several orderings are valid, so the generated C code is potentially different each time. Here is a proposal for a better way to compute the hash:
* Result_hash = Result version + Result desc
* Op_hash = Op version + Op desc + input/output hashes
* Env_hash = Env version + combination of the Op hashes and their traversal order wrt a consistent traversal method
* FunctionGraph_hash = FunctionGraph version + combination of the Op hashes and their traversal order wrt a consistent traversal method
The version could be set explicitly via a ``__version__`` field or it could simply be equal to the file's last modification date. We could also have a ``__nocache__`` field indicating that code produced by the Op or Result cannot be cached.
print'<% of local_time spent at this position> <cumulative %%> <apply time> <cumulative seconds> <time per call> [*] <nb_call> <Apply position> <Apply Op name>'
# time spent optimizing graph (FunctionMaker.__init__)
validate_time=0.0
# time spent in env.validate
# time spent in fgraph.validate
# This is a subset of optimizer_time that is dominated by toposort()
# when the destorymap feature is included.
...
...
@@ -506,7 +506,7 @@ class ProfileStats(object):
t*100/local_time,
t,
a,
a.env.toposort().index(a),
a.fgraph.toposort().index(a),
self.apply_callcount[a])
fora,tinself.apply_time.items()]
atimes.sort()
...
...
@@ -671,7 +671,7 @@ if 0: # old code still to be ported from ProfileMode
print"List of apply that don't have float64 as input but have float64 in outputs. Usefull to know if we forgot some cast when using floatX=float32 or gpu code."