Skip to content

Commit 9a47b62

Browse files
committed
Bug fix for BatchNorm when testing more than models in test mode.
1 parent 4f70880 commit 9a47b62

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)