提交 ae613167 authored 作者: Frederic Bastien's avatar Frederic Bastien

fix in the init of cuda.

上级 44bf5c63
...@@ -108,7 +108,7 @@ def use(device=config.device): ...@@ -108,7 +108,7 @@ def use(device=config.device):
raise ValueError("Invalid device identifier", device) raise ValueError("Invalid device identifier", device)
if use.device_number is None: if use.device_number is None:
# No successful call to use() has been made yet # No successful call to use() has been made yet
if device=="-1" or device=="CPU": if device<0:
return return
if device in [None,""]: if device in [None,""]:
device=0 device=0
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论