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

See gh-6543. Sometimes, np.asarray(self.data) fail with a read error from the…

See gh-6543. Sometimes, np.asarray(self.data) fail with a read error from the hardware. So here try some fall back that won't hide the current error being raised.
上级 63f69204
...@@ -603,7 +603,10 @@ class GpuArrayConstant(_operators, Constant): ...@@ -603,7 +603,10 @@ class GpuArrayConstant(_operators, Constant):
try: try:
np_data = np.asarray(self.data) np_data = np.asarray(self.data)
except gpuarray.GpuArrayException: except gpuarray.GpuArrayException:
np_data = self.data try:
np_data = str(self.data)
except Exception:
np_data = 'Unknown'
return "GpuArrayConstant{%s}" % np_data return "GpuArrayConstant{%s}" % np_data
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论