提交 77a05341 authored 作者: Razvan Pascanu's avatar Razvan Pascanu

fix bug in cython code

Cython can not handle negative indices ( because of a derictive at the begining of the function that says not to do boundschecks). This is used to make the code faster, so this workaround is better then removing the directive.
上级 1b4988c6
...@@ -455,7 +455,8 @@ def perform( ...@@ -455,7 +455,8 @@ def perform(
# if optimization gets applied compared to when optimization # if optimization gets applied compared to when optimization
# do not get applied # do not get applied
if i < n_steps: if i < n_steps:
outs[idx][0] = outs[idx][0][:-(n_steps - i)] sh0 = outs[idx][0].shape[0]
outs[idx][0] = outs[idx][0][:sh0-(n_steps - i)]
t_call = time.time() - t0_call t_call = time.time() - t0_call
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论