未验证 提交 0d8545f8 编写于 作者: H Huihuang Zheng 提交者: GitHub

Enable MNIST Multiple 'return' as Unit Test (#25556)

Enable multiple "return" statement in MNIST as Unit test in dy2stat.
上级 1a4a4219
...@@ -108,12 +108,9 @@ class MNIST(fluid.dygraph.Layer): ...@@ -108,12 +108,9 @@ class MNIST(fluid.dygraph.Layer):
loss = fluid.layers.cross_entropy(x, label) loss = fluid.layers.cross_entropy(x, label)
avg_loss = fluid.layers.mean(loss) avg_loss = fluid.layers.mean(loss)
# TODO: Uncomment code after "return" statement can be transformed correctly. return x, acc, avg_loss
else:
# return x, acc, avg_loss return x
# else:
# return x
return x, acc, avg_loss
def inference(self, inputs): def inference(self, inputs):
x = self._simple_img_conv_pool_1(inputs) x = self._simple_img_conv_pool_1(inputs)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册