提交 921756df authored 作者: Frederic's avatar Frederic

Raise an error when we run theano-nose with device==gpu.

上级 c6dabf84
...@@ -32,6 +32,17 @@ def main(): ...@@ -32,6 +32,17 @@ def main():
import theano import theano
sys.argv[i] = theano.__path__[0] sys.argv[i] = theano.__path__[0]
# Many Theano tests suppose device=cpu.
# I don't know how to do this tests only if we use theano-nose on Theano tests.
# So I make the try..except in case the script get reused elsewhere.
try:
import theano
if theano.config.device != "cpu":
raise ValueError("Theano tests must be run with device=cpu."
" This will also run GPU tests when possible.")
except ImportError:
pass
# Handle --batch[=n] arguments # Handle --batch[=n] arguments
batch_args = [arg for arg in sys.argv if arg.startswith('--batch')] batch_args = [arg for arg in sys.argv if arg.startswith('--batch')]
for arg in batch_args: for arg in batch_args:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论