提交 66a9e220 authored 作者: Frederic's avatar Frederic

Use [:mintap] instead of [:-n_tap_done], to make it use the same was as other…

Use [:mintap] instead of [:-n_tap_done], to make it use the same was as other place to help subtensor opt.
上级 b39f256c
...@@ -1587,9 +1587,11 @@ class Scan(PureOp): ...@@ -1587,9 +1587,11 @@ class Scan(PureOp):
# fct add and we want to keep it for all Scan op. This is # fct add and we want to keep it for all Scan op. This is
# used in T_Scan.test_grad_multiple_outs_taps to test # used in T_Scan.test_grad_multiple_outs_taps to test
# that. # that.
for x in self.outer_mitsot_outs(outs): for taps, x in zip(self.mitsot_taps(),
if hasattr(x[::-1][:inputs[0]].tag, 'test_value'): self.outer_mitsot_outs(outs)):
assert (x[::-1][:inputs[0]].tag.test_value.shape[0] == mintap = numpy.min(taps)
if hasattr(x[::-1][:mintap], 'test_value'):
assert (x[::-1][:mintap].tag.test_value.shape[0] ==
inputs[0].tag.test_value) inputs[0].tag.test_value)
for x in self.outer_sitsot_outs(outs): for x in self.outer_sitsot_outs(outs):
if hasattr(x[::-1][:-1].tag, 'test_value'): if hasattr(x[::-1][:-1].tag, 'test_value'):
...@@ -1599,8 +1601,9 @@ class Scan(PureOp): ...@@ -1599,8 +1601,9 @@ class Scan(PureOp):
if hasattr(x[::-1].tag, 'test_value'): if hasattr(x[::-1].tag, 'test_value'):
assert (x[::-1].tag.test_value.shape[0] == assert (x[::-1].tag.test_value.shape[0] ==
inputs[0].tag.test_value) inputs[0].tag.test_value)
outer_inp_seqs += [x[::-1][:inputs[0]] outer_inp_seqs += [x[::-1][:numpy.min(taps)]
for x in self.outer_mitsot_outs(outs)] for taps, x in zip(self.mitsot_taps(),
self.outer_mitsot_outs(outs))]
outer_inp_seqs += [x[::-1][:-1] for x in self.outer_sitsot_outs(outs)] outer_inp_seqs += [x[::-1][:-1] for x in self.outer_sitsot_outs(outs)]
outer_inp_seqs += [x[::-1] for x in self.outer_nitsot_outs(outs)] outer_inp_seqs += [x[::-1] for x in self.outer_nitsot_outs(outs)]
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论