提交 d72325e4 authored 作者: Pascal Lamblin's avatar Pascal Lamblin 提交者: GitHub

Merge pull request #5103 from nouiz/floatX_error

Make device=gpu with floatX=float16 raise an error (cause many user q…
......@@ -530,6 +530,15 @@ def use(device,
# No successful call to use() has been made yet
if device != 'gpu' and device < 0:
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
pycuda_init_dev = False
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论