Cache opt

Try to address some comments from P.L.
This is the initial pull request for Theano issue #2203.
This method should return optimizer_profile and you should use it. Otherwise, you probably get a problem as you will use a variable that isn't defined.

When you find the graph, return None for optimizer_profile