提交 ee4cea6a authored 作者: Frederic Bastien's avatar Frederic Bastien

Fix for python 3

上级 9840faaf
......@@ -779,9 +779,7 @@ def split_huge_add_or_mul(node):
return False
while len(node.inputs) > max_nb_inputs:
inner_op = []
for i in xrange(0,
len(node.inputs),
max_nb_inputs):
for i in range(0, len(node.inputs), max_nb_inputs):
inner_op.append(node.op(*node.inputs[i: i + max_nb_inputs]))
node = node.op(*inner_op).owner
return node
......
......@@ -482,16 +482,16 @@ def test_many_arg_elemwise():
i.e., it is a test of the optimization theano/sandbox/cuda/opt.py:local_gpu_huge_add_or_mul """
rng = np.random.RandomState([1, 2, 3])
for num_args in [25]:
for num_args in [55]:
for op_to_test in [theano.tensor.add, theano.tensor.mul]:
for nb_dim in [2, 3, 4, 5]:
shapes = [rng.randint(1, 5) for i in range(nb_dim)]
args = [np.cast['float32'](rng.randn(*shapes))
for arg in xrange(0, num_args)]
for arg in range(0, num_args)]
symb_args = [theano.tensor.TensorType('float32',
(False,) * nb_dim)()
for arg in xrange(0, num_args)]
for arg in range(0, num_args)]
outputs = []
for mode in [mode_with_gpu, mode_without_gpu]:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论