提交 477b915b authored 作者: Frédéric Bastien's avatar Frédéric Bastien 提交者: GitHub

Merge pull request #5282 from nouiz/cleanup_crash_fix

Clean up and also fix the crash in the code example of gh-4679.
...@@ -191,8 +191,8 @@ class ExtractDiag(Op): ...@@ -191,8 +191,8 @@ class ExtractDiag(Op):
if x.type.ndim != 2: if x.type.ndim != 2:
raise TypeError('ExtractDiag only works on matrices', _x) raise TypeError('ExtractDiag only works on matrices', _x)
return Apply(self, [x], [x.type.__class__(broadcastable=(False,), y = x.type.clone(broadcastable=(False,))()
dtype=x.type.dtype)()]) return Apply(self, [x], [y])
def perform(self, node, ins, outs): def perform(self, node, ins, outs):
""" For some reason numpy.diag(x) is really slow, so we """ For some reason numpy.diag(x) is really slow, so we
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论