提交 f02d736b authored 作者: Frederic's avatar Frederic

Try to fix the problem that depending of the inputs strides, the outputs strides…

Try to fix the problem that depending of the inputs strides, the outputs strides of dimensions of size 1 get strides that make it considered not aligned by the PyArray_ALIGNED macro.
上级 d534299b
...@@ -308,7 +308,8 @@ class DimShuffle(Op): ...@@ -308,7 +308,8 @@ class DimShuffle(Op):
for i, o in enumerate(self.new_order): for i, o in enumerate(self.new_order):
if o != 'x': if o != 'x':
strides_statements += [('strides[' + str(i) strides_statements += [('strides[' + str(i)
+ '] = PyArray_STRIDES(%(basename)s)[' + str(o) + ']')] + '] = PyArray_DIMS(%(basename)s)[' + str(o)
+ '] == 1? 0 : PyArray_STRIDES(%(basename)s)[' + str(o) + ']')]
else: else:
strides_statements += [('strides[' + str(i) + '] = 0')] strides_statements += [('strides[' + str(i) + '] = 0')]
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论