Skip to content

Commit

Permalink
Small typo fixes + unsafe string comparison fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Olivier Delalleau committed Jul 19, 2013
1 parent 05f36e3 commit 4fab8bf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
14 changes: 7 additions & 7 deletions doc/tutorial/debug_faq.txt
Original file line number Diff line number Diff line change
Expand Up @@ -288,12 +288,12 @@ can be achieved as follows:

To help understand what is happening in your graph, you can
disable the ``local_elemwise_fusion`` and all ``inplace``
optimizations. The first is a speed optimization that merge elemwise
operations together. This make it harder to know which particular
elemwise cause the problem. The second optimization make some ops
output overwrite its input. So, if an op create a bad output, you
won't be able see the input that was overwriten in the ``post_fun``
function. To disable those optimization (with a Theano version after
optimizations. The first is a speed optimization that merges elemwise
operations together. This makes it harder to know which particular
elemwise causes the problem. The second optimization makes some ops'
outputs overwrite their inputs. So, if an op creates a bad output, you
will not be able to see the input that was overwriten in the ``post_func``
function. To disable those optimizations (with a Theano version after
0.6rc3), define the MonitorMode like this:

.. code-block:: python
Expand All @@ -311,7 +311,7 @@ function. To disable those optimization (with a Theano version after
mode with MonitorMode, as you need to define what you monitor.

To be sure all inputs of the node are available during the call to
``post_func``, you also must disable the garbage collector. Otherwise,
``post_func``, you must also disable the garbage collector. Otherwise,
the execution of the node can garbage collect its inputs that aren't
needed anymore by the Theano function. This can be done with the Theano
flag:
Expand Down
4 changes: 2 additions & 2 deletions theano/compile/monitormode.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ def __init__(self, pre_func=None, post_func=None,
:param optimizer: The optimizer to use. One may use for instance
'fast_compile' to skip optimizations.
:param linker: DO NOT USE. This mode use its own linker.
:param linker: DO NOT USE. This mode uses its own linker.
The parameter is needed to allow selecting optimizers to use.
"""
self.pre_func = pre_func
self.post_func = post_func
wrap_linker = theano.gof.WrapLinkerMany([theano.gof.OpWiseCLinker()],
[self.eval])
if optimizer is 'default':
if optimizer == 'default':
optimizer = theano.config.optimizer
if (linker is not None and
not isinstance(linker.mode, MonitorMode)):
Expand Down
3 changes: 2 additions & 1 deletion theano/compile/pfunc.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,8 @@ def pfunc(params, outputs=None, mode=None, updates=None, givens=None,
if len(updates) > 0 and any(isinstance(v, Variable)
for v in iter_over_pairs(updates)):
raise ValueError(
"The updates parameter must an OrderedDict/dict or a list of list/tuple with 2 elements")
"The updates parameter must be an OrderedDict/dict or a list of "
"lists/tuples with 2 elements")

# transform params into theano.compile.In objects.
inputs = [_pfunc_param_to_in(p, allow_downcast=allow_input_downcast)
Expand Down

0 comments on commit 4fab8bf

Please sign in to comment.