changeset 1525:9c24a2bdbe90

a test is too slow when run in debugmode, so we force fast_run in that case.
author Frederic Bastien <nouiz@nouiz.org>
date Fri, 09 Nov 2012 14:48:26 -0500
parents 9d21919e2332
children 5804e44d7a1b
files pylearn/algorithms/tests/test_mcRBM.py
diffstat 1 files changed, 14 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/pylearn/algorithms/tests/test_mcRBM.py	Fri Nov 02 13:02:18 2012 -0400
+++ b/pylearn/algorithms/tests/test_mcRBM.py	Fri Nov 09 14:48:26 2012 -0500
@@ -24,7 +24,20 @@
                               persistent_chains=persistent_chains)
 
 
-def test_reproduce_ranzato_hinton_2010(
+def test_reproduce_ranzato_hinton_2010():
+    # We need to modify the global mode as otherwise there is a
+    # function being compiler in the sample that won't use the mode we
+    # want.
+    try:
+        orig_mode = theano.config.mode
+        if theano.config.mode in ["DebugMode", "DEBUG_MODE"]:
+            theano.config.mode = "FAST_RUN"
+        reproduce_ranzato_hinton_2010()
+    finally:
+        theano.config.mode = orig_mode
+
+
+def reproduce_ranzato_hinton_2010(
         dataset='MAR', as_unittest=True, n_train_iters=5000,
         rbm_alloc=_default_rbm_alloc, trainer_alloc=_default_trainer_alloc,
         lr_per_example=.075,