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

fix 2 tests on 32 bits computer.

上级 aba58aec
...@@ -2,7 +2,7 @@ import numpy ...@@ -2,7 +2,7 @@ import numpy
import unittest import unittest
import copy import copy
import theano import theano
from theano.tensor import Tensor, dmatrix, dvector, lscalar, dmatrices from theano.tensor import dmatrix, iscalar, lscalar, dmatrices
from theano import tensor from theano import tensor
from theano.compile.sharedvalue import * from theano.compile.sharedvalue import *
...@@ -407,6 +407,9 @@ class Test_pfunc(unittest.TestCase): ...@@ -407,6 +407,9 @@ class Test_pfunc(unittest.TestCase):
def test_default_updates_input(self): def test_default_updates_input(self):
x = shared(0) x = shared(0)
y = shared(1) y = shared(1)
if theano.gof.cmodule.local_bitwidth()==32:
a = iscalar('a')
else:
a = lscalar('a') a = lscalar('a')
x.default_update = y x.default_update = y
......
...@@ -15,6 +15,9 @@ class Test_SharedVariable(unittest.TestCase): ...@@ -15,6 +15,9 @@ class Test_SharedVariable(unittest.TestCase):
assert shared(7.0).type == Scalar('float64') assert shared(7.0).type == Scalar('float64')
assert shared(7, dtype='float64').type == Scalar('float64') assert shared(7, dtype='float64').type == Scalar('float64')
else:
if theano.gof.cmodule.local_bitwidth()==32:
assert shared(7).type == theano.tensor.iscalar, shared(7).type
else: else:
assert shared(7).type == theano.tensor.lscalar, shared(7).type assert shared(7).type == theano.tensor.lscalar, shared(7).type
assert shared(7.0).type == theano.tensor.dscalar assert shared(7.0).type == theano.tensor.dscalar
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论