提交 520ffd88 authored 作者: Olivier Delalleau's avatar Olivier Delalleau

Merge pull request #291 from nouiz/fix_device

fix gpu tests when using theano flags device.
......@@ -65,9 +65,9 @@ def test_dot_mv():
def test_gemv1():
''' test vector1+dot(matrix,vector2) '''
v1 = theano.shared( numpy.array(numpy.random.rand(2) , dtype='float32'))
v2 = theano.shared( numpy.array(numpy.random.rand(5) , dtype='float32'))
m = theano.shared( numpy.array(numpy.random.rand(5,2), dtype='float32'))
v1 = theano.tensor._shared( numpy.array(numpy.random.rand(2) , dtype='float32'))
v2 = theano.tensor._shared( numpy.array(numpy.random.rand(5) , dtype='float32'))
m = theano.tensor._shared( numpy.array(numpy.random.rand(5,2), dtype='float32'))
no_gpu_f = theano.function([], v2+theano.dot(m,v1), mode = mode_without_gpu)
gpu_f = theano.function([], v2+theano.dot(m,v1), mode = mode_with_gpu)
......
......@@ -2713,7 +2713,7 @@ class T_Join_and_Split(unittest.TestCase):
# tested only on cpu as gpu support only float32
a = as_tensor_variable(1)
b = as_tensor_variable(2.0)
c = shared(numpy.asarray(3.0, dtype=self.floatX))
c = tensor._shared(numpy.asarray(3.0, dtype=self.floatX))
s = stack(a, b, c)
want = numpy.array([1, 2, 3])
out = self.eval_outputs_and_check_vector([s], opt.MakeVector)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论