提交 97f1b4f0 authored 作者: Frederic Bastien's avatar Frederic Bastien

make test pass on computer with nvcc but not cuda enabled card.

上级 da2cc473
...@@ -345,7 +345,7 @@ def test_uniform(): ...@@ -345,7 +345,7 @@ def test_uniform():
#print 'random?[-1,-10:]\n', out[-1,-10:] #print 'random?[-1,-10:]\n', out[-1,-10:]
basictest(f, steps, sample_size, prefix='mrg cpu', inputs=input) basictest(f, steps, sample_size, prefix='mrg cpu', inputs=input)
if mode!='FAST_COMPILE': if mode!='FAST_COMPILE' and cuda_available:
print '' print ''
print 'ON GPU with size=(%s):'%str(size) print 'ON GPU with size=(%s):'%str(size)
R = MRG_RandomStreams(234, use_cuda=True) R = MRG_RandomStreams(234, use_cuda=True)
...@@ -403,7 +403,7 @@ def test_binomial(): ...@@ -403,7 +403,7 @@ def test_binomial():
print 'random?[-1,-10:]\n', out[-1,-10:] print 'random?[-1,-10:]\n', out[-1,-10:]
basictest(f, steps, sample_size, prefix='mrg cpu', inputs=input, allow_01=True, target_avg = mean) basictest(f, steps, sample_size, prefix='mrg cpu', inputs=input, allow_01=True, target_avg = mean)
if mode!='FAST_COMPILE': if mode!='FAST_COMPILE' and cuda_available:
print '' print ''
print 'ON GPU with size=(%s) and mean(%d):'%(str(size),mean) print 'ON GPU with size=(%s) and mean(%d):'%(str(size),mean)
R = MRG_RandomStreams(234, use_cuda=True) R = MRG_RandomStreams(234, use_cuda=True)
...@@ -450,7 +450,7 @@ def test_normal0(): ...@@ -450,7 +450,7 @@ def test_normal0():
# now with odd number of samples # now with odd number of samples
sample_size = (sample_size[0],sample_size[1]-1) sample_size = (sample_size[0],sample_size[1]-1)
if mode!='FAST_COMPILE': if mode!='FAST_COMPILE' and cuda_available:
print '' print ''
print 'ON GPU:' print 'ON GPU:'
R = MRG_RandomStreams(234, use_cuda=True) R = MRG_RandomStreams(234, use_cuda=True)
...@@ -465,7 +465,7 @@ def test_normal0(): ...@@ -465,7 +465,7 @@ def test_normal0():
print 'random?[:10]\n', numpy.asarray(f())[0,0:10] print 'random?[:10]\n', numpy.asarray(f())[0,0:10]
print '----' print '----'
sys.stdout.flush() sys.stdout.flush()
basictest(f, steps, sample_size_odd, target_avg=-5.0, target_std=2.0, prefix='gpu mrg ', allow_01=True) basictest(f, steps, sample_size, target_avg=-5.0, target_std=2.0, prefix='gpu mrg ', allow_01=True)
print '' print ''
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论