提交 776ea7c2 authored 作者: Razvan Pascanu's avatar Razvan Pascanu

Catching better the exception of numpy.linalg.inv

上级 1442f517
......@@ -363,7 +363,7 @@ class MatrixInverse(Op):
def perform(self, node, (x,), (z, )):
try:
z[0] = numpy.linalg.inv(x).astype(x.dtype)
except Exception:
except numpy.linalg.LinAlgError:
print 'Failed to invert', node.inputs[0]
raise
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论