提交 ab7ce34c authored 作者: Mohammad Pezeshki's avatar Mohammad Pezeshki 提交者: Pascal Lamblin

testing using FunctionGraph instead of function

上级 91224f1e
......@@ -5195,9 +5195,10 @@ class T_reshape(utt.InferShapeTester, utt.TestOptimizationMixin):
# test broadcast flag for constant value of 1
c = reshape(b, (b.shape[0], b.shape[1], 1))
f = self.function([b], c)
g = theano.gof.FunctionGraph([b], [c])
assert numpy.all(f(numpy.asarray([[0, 1, 2], [3, 4, 5]])) ==
numpy.asarray([[[0], [1], [2]], [[3], [4], [5]]]))
assert (f.maker.fgraph.toposort()[-2].outputs[0].type.broadcastable ==
assert (g.toposort()[-1].outputs[0].type.broadcastable ==
(False, False, True))
def test_m1(self):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论