From a7e847b648fb0084990ee914e1365b017436ce4e Mon Sep 17 00:00:00 2001 From: tensor-tang Date: Wed, 10 Jan 2018 16:31:05 +0800 Subject: [PATCH] fix ds2 issue --- paddle/gserver/layers/MKLDNNLayer.cpp | 2 ++ paddle/gserver/layers/MKLDNNLayer.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/paddle/gserver/layers/MKLDNNLayer.cpp b/paddle/gserver/layers/MKLDNNLayer.cpp index 6fbf3c7fdec..2d0fff608c3 100644 --- a/paddle/gserver/layers/MKLDNNLayer.cpp +++ b/paddle/gserver/layers/MKLDNNLayer.cpp @@ -132,6 +132,8 @@ void MKLDNNLayer::reshapeInput(int& batchsize, if (w != 0) { width = w; } + height = height != 0 ? height : 1; + width = width != 0 ? width : 1; } void MKLDNNLayer::reshapeOutput(size_t height, size_t width) { diff --git a/paddle/gserver/layers/MKLDNNLayer.h b/paddle/gserver/layers/MKLDNNLayer.h index e48b9b5a91f..3ba39f18b6a 100644 --- a/paddle/gserver/layers/MKLDNNLayer.h +++ b/paddle/gserver/layers/MKLDNNLayer.h @@ -98,6 +98,8 @@ protected: public: explicit MKLDNNLayer(const LayerConfig& config) : Layer(config), + ih_(0), + iw_(0), condition_(0), needResetBwd_(true), outputOnlyMKLDNN_(false), -- GitLab