提交 301f7a2f authored 作者: Frederic Bastien's avatar Frederic Bastien

Make device=gpu with floatX=float16 raise an error (cause many user questions…

Make device=gpu with floatX=float16 raise an error (cause many user questions and this should never be used). if floatX=float64, raise an error.
上级 173826a7
...@@ -530,6 +530,15 @@ def use(device, ...@@ -530,6 +530,15 @@ def use(device,
# No successful call to use() has been made yet # No successful call to use() has been made yet
if device != 'gpu' and device < 0: if device != 'gpu' and device < 0:
return return
msg = ("Theano flag device=gpu* (old gpu back-end) only support"
" floatX=float32. You have floatX=%s. Use the new gpu"
" back-end with device=cuda* for that value of floatX." %
config.floatX)
if config.floatX == 'float16':
raise RuntimeError(msg)
elif config.floatX == 'float64':
warnings.warn(msg)
# Has PyCUDA already initialized the GPU context # Has PyCUDA already initialized the GPU context
pycuda_init_dev = False pycuda_init_dev = False
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论