提交 130c01f8 authored 作者: Olivier Delalleau's avatar Olivier Delalleau

Fixes for Python 2.4

上级 766e8124
...@@ -12,7 +12,7 @@ except ImportError: ...@@ -12,7 +12,7 @@ except ImportError:
import theano import theano
from theano import compile, config from theano import compile, config
from theano.sparse import enable_sparse from theano.sparse import enable_sparse
from theano.gof.python25 import all, product from theano.gof.python25 import all, any, product
if enable_sparse == False: if enable_sparse == False:
raise SkipTest('Optional package sparse disabled') raise SkipTest('Optional package sparse disabled')
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
import itertools, sys import itertools, sys
import theano.tensor as T import theano.tensor as T
from theano import tensor from theano import tensor
#from theano.gof import Env from theano.gof.python25 import product as itertools_product
from theano.printing import pp from theano.printing import pp
import numpy import numpy
...@@ -1535,7 +1535,7 @@ class TestBlasStrides(TestCase): ...@@ -1535,7 +1535,7 @@ class TestBlasStrides(TestCase):
mode=self.mode) mode=self.mode)
# Try with all stride patterns, and all transposed pattern # Try with all stride patterns, and all transposed pattern
for step_signs in itertools.product((-1, 1), repeat=4): for step_signs in itertools_product((-1, 1), repeat=4):
for step in (1, 2): for step in (1, 2):
b_step1, b_step2, c_step1, c_step2 = (s * step b_step1, b_step2, c_step1, c_step2 = (s * step
for s in step_signs) for s in step_signs)
...@@ -1605,7 +1605,7 @@ class TestBlasStrides(TestCase): ...@@ -1605,7 +1605,7 @@ class TestBlasStrides(TestCase):
mode=self.mode) mode=self.mode)
# Try with all stride patterns, and all transposed pattern # Try with all stride patterns, and all transposed pattern
for step_signs in itertools.product((-1, 1), repeat=4): for step_signs in itertools_product((-1, 1), repeat=4):
for step in (1, 2): for step in (1, 2):
b_step1, b_step2, c_step1, c_step2 = (s * step b_step1, b_step2, c_step1, c_step2 = (s * step
for s in step_signs) for s in step_signs)
...@@ -1692,7 +1692,7 @@ class TestBlasStrides(TestCase): ...@@ -1692,7 +1692,7 @@ class TestBlasStrides(TestCase):
mode=self.mode) mode=self.mode)
# Try with all stride patterns, and all transposed pattern # Try with all stride patterns, and all transposed pattern
for step_signs in itertools.product((-1, 1), repeat=6): for step_signs in itertools_product((-1, 1), repeat=6):
for step in (1, 2): for step in (1, 2):
a_step1, a_step2, b_step1, b_step2, c_step1, c_step2 = \ a_step1, a_step2, b_step1, b_step2, c_step1, c_step2 = \
(s * step for s in step_signs) (s * step for s in step_signs)
...@@ -1785,7 +1785,7 @@ class TestBlasStrides(TestCase): ...@@ -1785,7 +1785,7 @@ class TestBlasStrides(TestCase):
mode=self.mode) mode=self.mode)
# Try with all stride patterns, and all transposed pattern # Try with all stride patterns, and all transposed pattern
for step_signs in itertools.product((1, -1), repeat=4): for step_signs in itertools_product((1, -1), repeat=4):
for step in (1, 2): for step in (1, 2):
a_step, b_step1, b_step2, c_step = (s * step a_step, b_step1, b_step2, c_step = (s * step
for s in step_signs) for s in step_signs)
...@@ -1841,7 +1841,7 @@ class TestBlasStrides(TestCase): ...@@ -1841,7 +1841,7 @@ class TestBlasStrides(TestCase):
mode=self.mode) mode=self.mode)
# Try with all stride patterns, and all transposed patterns # Try with all stride patterns, and all transposed patterns
for step_signs in itertools.product((1, -1), repeat=4): for step_signs in itertools_product((1, -1), repeat=4):
for step in (1, 2): for step in (1, 2):
a_step1, a_step2, b_step, c_step = (s * step a_step1, a_step2, b_step, c_step = (s * step
for s in step_signs) for s in step_signs)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论