Skip to content

Commit 16d16b4

Browse files
authored
Merge pull request #999 from qingqing01/bug_fix
Bug fix for BatchNorm when testing more than models in test mode.
2 parents c6d9d04 + ae00095 commit 16d16b4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

paddle/gserver/layers/BatchNormalizationLayer.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ class BatchNormalizationLayer : public BatchNormBaseLayer {
5858
/// to batch, channels* imagePixels.
5959
void shrinkMat(const MatrixPtr& in, MatrixPtr& out);
6060

61+
void onPassEnd() { firstTest_ = true; }
62+
6163
MatrixPtr tmpMat_, tmpGrad_;
6264
MatrixPtr expandedIn_, expandedOut_;
6365
MatrixPtr expandedInGrad_, expandedOutGrad_, inGrad_;

0 commit comments

Comments
 (0)