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

Remove tuple-unpacking in args.

上级 d2975234
...@@ -403,7 +403,9 @@ class ExtractDiag(Op): ...@@ -403,7 +403,9 @@ 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], [tensor.vector(dtype=x.type.dtype)]) return Apply(self, [x], [tensor.vector(dtype=x.type.dtype)])
def perform(self, node, (x,), (z,)): def perform(self, node, ins, outs):
x, = ins
z, = outs
#for some reason numpy.diag(x) is really slow #for some reason numpy.diag(x) is really slow
N,M = x.shape N,M = x.shape
assert N==M assert N==M
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论