提交 6d692abb authored 作者: Frederic's avatar Frederic

pep8

上级 cf7a3691
......@@ -22,7 +22,7 @@ def test_graph_equivalence():
g1_b = T.fmatrix('inputs')
g1_y = T.sum(g1_a+g1_b)
g1_yy = T.sum(g1_a + g1_b)
g2_x = T.fmatrix('inputs')
g2_y = g2_x.sum()
......@@ -30,7 +30,7 @@ def test_graph_equivalence():
g3_b = T.fmatrix('inputs')
g3_y = T.sum(g3_a+g3_b)
assert is_same_graph(g1_y, g2_y) == False
assert is_same_graph(g1_y, g2_y) is False
# This does not work.
assert is_same_graph(g1_y, g1_y)
assert is_same_graph(g1_y, g1_yy)
......@@ -38,18 +38,19 @@ def test_graph_equivalence():
l1 = theano.gof.graph.inputs([g1_y])
l2 = theano.gof.graph.inputs([g3_y])
assert len(l1) == len(l2)
#FunctionGraph([], g1_y)
#assert graphs_equal(g1_y, g3_y) == True
#assert graphs_equal(g1_y, g2_y) == False
def test_graph_optimization_caching():
#
x = T.fmatrix('inputs')
y = x.sum()
f = theano.function(inputs=[x],outputs=y)
f = theano.function(inputs=[x], outputs=y)
if __name__ == '__main__':
test_graph_optimization_caching()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论