提交 98c241c8 authored 作者: AdeB's avatar AdeB 提交者: Pascal Lamblin

fix stack traces problems in test_nnent.py

上级 6e85e214
...@@ -661,7 +661,9 @@ class T_CrossentropyCategorical1Hot(utt.InferShapeTester): ...@@ -661,7 +661,9 @@ class T_CrossentropyCategorical1Hot(utt.InferShapeTester):
fgraph = gof.FunctionGraph( fgraph = gof.FunctionGraph(
[x, one_of_n], [x, one_of_n],
[g_x]) [g_x])
assert check_stack_trace(fgraph, ops_to_check='last') assert check_stack_trace(
fgraph, ops_to_check=[crossentropy_softmax_1hot_with_bias_dx,
softmax_op])
# print 'BEFORE' # print 'BEFORE'
# for node in fgraph.toposort(): # for node in fgraph.toposort():
...@@ -1301,6 +1303,8 @@ def test_argmax_pushdown(): ...@@ -1301,6 +1303,8 @@ def test_argmax_pushdown():
assert len(fgraph.toposort()) == 2 # an output_guard is second assert len(fgraph.toposort()) == 2 # an output_guard is second
assert fgraph.toposort()[0].op == tensor.basic._max_and_argmax assert fgraph.toposort()[0].op == tensor.basic._max_and_argmax
assert str(fgraph.toposort()[1].op) == 'OutputGuard' assert str(fgraph.toposort()[1].op) == 'OutputGuard'
assert check_stack_trace(
fgraph, ops_to_check=tensor.basic._max_and_argmax)
x = tensor.matrix() x = tensor.matrix()
# test that the max_and_argmax is not pushed down if the max is used # test that the max_and_argmax is not pushed down if the max is used
out = tensor.max_and_argmax( out = tensor.max_and_argmax(
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论