提交 8dbc513a authored 作者: Frederic's avatar Frederic

Small modif to make the output of get_canonical_form_slice() simpler<

and test that the opt was applied.
上级 494a4c6f
......@@ -100,6 +100,7 @@ def get_canonical_form_slice(theslice, length):
if step is None:
step = 1
is_step_constant = True
# First handle the easier and common case where `step` is 1 and
# either `start` or `stop` is a range boundary. More specializations
......
......@@ -2408,10 +2408,10 @@ def test_local_subtensor_of_alloc():
for slices in slicess:
z = yx.__getitem__(slices)
f = theano.function([x], z)
# theano.printing.debugprint(f)
# if theano.config.mode != 'FAST_COMPILE':
# assert not any([isinstance(node.op, Subtensor)
# for node in f.maker.fgraph.toposort()])
if theano.config.mode != 'FAST_COMPILE':
# Subtensor can be in the input of Alloc
assert not isinstance(f.maker.fgraph.toposort()[-1].op,
Subtensor)
val = f(xval)
assert xval.__getitem__(slices).shape == val.shape
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论