Skip to content

Commit

Permalink
Enable MNIST Multiple 'return' as Unit Test (PaddlePaddle#25556)
Browse files Browse the repository at this point in the history
Enable multiple "return" statement in MNIST as Unit test in dy2stat.
  • Loading branch information
zhhsplendid authored Jul 17, 2020
1 parent 1a4a421 commit 0d8545f
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,9 @@ def forward(self, inputs, label=None):
loss = fluid.layers.cross_entropy(x, label)
avg_loss = fluid.layers.mean(loss)

# TODO: Uncomment code after "return" statement can be transformed correctly.

# return x, acc, avg_loss
# else:
# return x
return x, acc, avg_loss
return x, acc, avg_loss
else:
return x

def inference(self, inputs):
x = self._simple_img_conv_pool_1(inputs)
Expand Down

0 comments on commit 0d8545f

Please sign in to comment.