提交 a4bf4d3d authored 作者: Frederic Bastien's avatar Frederic Bastien 提交者: Frederic

Add test for the fixed crash with the opt merge of slices.

上级 262bb743
""" This file don't test everything. It only test one past crash error."""
import theano
from theano.tensor.type_other import MakeSlice, make_slice
def test_make_slice_merge():
# In the past, this was crahsing during compilation.
i = theano.tensor.iscalar()
s1 = make_slice(0, i)
s2 = make_slice(0, i)
f = theano.function([i], [s1, s2])
nodes = f.maker.fgraph.nodes
assert len([n for n in nodes if isinstance(n.op, MakeSlice)]) == 1
theano.printing.debugprint(f)
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论