提交 3f6e5669 authored 作者: Razvan Pascanu's avatar Razvan Pascanu

clipping inputs in numpy solution

上级 e8df46f0
...@@ -159,7 +159,12 @@ class TestScan(unittest.TestCase): ...@@ -159,7 +159,12 @@ class TestScan(unittest.TestCase):
nw_inputs = [] nw_inputs = []
for inp, info in zip(new_ins, inputs_info): for inp, info in zip(new_ins, inputs_info):
taps = [x['tap'] for x in info] taps = [x['tap'] for x in info]
nw_inputs += [inp[abs(numpy.min(taps)) + k:] for k in taps]
if numpy.min(taps) < 0:
_offset = abs(numpy.min(taps))
else:
_offset = 0
nw_inputs += [inp[_offset + k:] for k in taps]
# Simplify the states by slicing them according to the taps. # Simplify the states by slicing them according to the taps.
# Note that if the memory buffer for the inputs and outputs is # Note that if the memory buffer for the inputs and outputs is
# the same, by changing the outputs we also change the outputs # the same, by changing the outputs we also change the outputs
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论