Skip to content

Commit 7a322df

Browse files
author
wangyang59
committed
deconv implementation mionr changes in ConvBaseLayer.cpp and config_parser.py
1 parent d116b17 commit 7a322df

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

paddle/gserver/layers/ConvBaseLayer.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,8 @@ bool ConvBaseLayer::init(const LayerMap& layerMap,
2020
const ParameterMap& parameterMap) {
2121
/* Initialize the basic parent class */
2222
Layer::init(layerMap, parameterMap);
23-
24-
if (config_.type() == "exconv" || config_.type() == "cudnn_conv") {
25-
isDeconv_ = false;
26-
} else {
27-
isDeconv_ = true;
28-
}
23+
isDeconv_ = (config_.type() == "exconv" || config_.type() == "cudnn_conv")
24+
? false : true;
2925

3026
/* Initialize the convolutional layer parameter */
3127
numFilters_ = config_.num_filters();
@@ -111,9 +107,9 @@ size_t ConvBaseLayer::calOutputSize() {
111107
outputSize(inH[i], filterSizeY_[i], paddingY_[i], strideY_[i]));
112108
outW.push_back(
113109
outputSize(inW[i], filterSize_[i], padding_[i], stride_[i]));
114-
CHECK_EQ(outH[i], outH[0]);
115-
CHECK_EQ(outW[i], outW[0]);
116110
}
111+
CHECK_EQ(outH[i], outH[0]);
112+
CHECK_EQ(outW[i], outW[0]);
117113
}
118114
getOutput().setFrameHeight(outH[0]);
119115
getOutput().setFrameWidth(outW[0]);

python/paddle/trainer/config_parser.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1666,11 +1666,6 @@ def __init__(
16661666
if self.layer_type == "cudnn_convt":
16671667
config_assert(use_gpu, "cudnn_convt only support GPU")
16681668

1669-
# if (use_gpu == 1 and self.layer_type != "exconvt" and
1670-
# (parallel_nn == 0 or self.config.device > -1)):
1671-
# self.layer_type = "cudnn_convt"
1672-
# else:
1673-
# self.layer_type = "exconvt"
16741669
# cudnn_convt has not been implemented so use exconvt only
16751670
self.layer_type = "exconvt"
16761671
# need to specify layer in config

0 commit comments

Comments
 (0)