提交 acf20ff6 authored 作者: James Bergstra's avatar James Bergstra

modified ScipyGer to work inplace on C-contiguous data

上级 8451a929
...@@ -44,8 +44,13 @@ class ScipyGer(Ger): ...@@ -44,8 +44,13 @@ class ScipyGer(Ger):
def rval(): def rval():
# N.B. some versions of scipy (e.g. mine) don't actually work # N.B. some versions of scipy (e.g. mine) don't actually work
# in-place on a, even when I tell it to. # in-place on a, even when I tell it to.
A = local_ger(calpha[0], cx[0], cy[0], a=cA[0], A = cA[0]
overwrite_a=int(self.destructive)) if A.flags['C_CONTIGUOUS']:
A = local_ger(calpha[0], cy[0], cx[0], a=A.T,
overwrite_a=int(self.destructive)).T
else:
A = local_ger(calpha[0], cx[0], cy[0], a=A,
overwrite_a=int(self.destructive))
cZ[0] = A cZ[0] = A
#TODO: If this is currently an unofficial part of the thunk API, #TODO: If this is currently an unofficial part of the thunk API,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论