Skip to content

Commit 0f42e56

Browse files
Merge pull request #4045 from chengduoZH/fix_SwitchOrderLayer
fix SwitchOrderLayer forward
2 parents 8631e79 + e76eb85 commit 0f42e56

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

paddle/gserver/layers/SwitchOrderLayer.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ void SwitchOrderLayer::forward(PassType passType) {
8383
setOutDims();
8484
resetOutput(outDims_[0], outDims_[1] * outDims_[2] * outDims_[3]);
8585
if (heightAxis_.size() > 0) {
86-
getOutputValue()->reshape(reshapeHeight_, reshapeWidth_);
87-
getOutputGrad()->reshape(reshapeHeight_, reshapeWidth_);
86+
resetOutput(reshapeHeight_, reshapeWidth_);
8887
}
8988

9089
// switch NCHW to NHWC

0 commit comments

Comments
 (0)