提交 defa1d3a authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Check the api version of pygpu/libgpuarray before using a pygpu device.

上级 2b561742
...@@ -33,6 +33,11 @@ from . import opt ...@@ -33,6 +33,11 @@ from . import opt
def init_dev(dev): def init_dev(dev):
if pygpu.gpuarray.api_version() != (-10000, 0):
raise RuntimeError("Wrong API version for gpuarray:",
pygpu.gpuarray.api_version(),
"Make sure Theano and libgpuarray/pygpu "
"are in sync.")
global pygpu_activated global pygpu_activated
context = pygpu.init(dev) context = pygpu.init(dev)
pygpu.set_default_context(context) pygpu.set_default_context(context)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论