From 98b7c6736445de1f287156e933b0d625f648e6da Mon Sep 17 00:00:00 2001 From: tensor-tang Date: Mon, 28 Aug 2017 09:52:58 +0800 Subject: [PATCH] add todo --- paddle/gserver/layers/MKLDNNFcLayer.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/paddle/gserver/layers/MKLDNNFcLayer.cpp b/paddle/gserver/layers/MKLDNNFcLayer.cpp index ad50c15a7..d38e6a209 100644 --- a/paddle/gserver/layers/MKLDNNFcLayer.cpp +++ b/paddle/gserver/layers/MKLDNNFcLayer.cpp @@ -184,15 +184,14 @@ void MKLDNNFcLayer::resetBwd() { const MatrixPtr& wgt = weight_->getWGrad(); const MatrixPtr& bias = hasBias ? biases_->getWGrad() : nullptr; + // TODO(TJ): merge topdiffs if (nextIsMKLDNN()) { // can not directly cast outputgrad to mkldnnmatrix, // since each layer can not write the inputgrad to mkldnn inputgrad. // So just create from matrix with outputvalue format. const MatrixPtr& out = getOutput(MKLDNN_DEVICE).grad; outGrad_ = MKLDNNMatrix::create(out, outVal_->getPD()); - // TODO: maybe need merge topdiffs } else { - // TODO: merge topdiffs const MatrixPtr& out = getOutput(CPU_DEVICE).grad; // fc do not need to convert from cpu device since output always nc // only need create from cpu device @@ -234,8 +233,7 @@ void MKLDNNFcLayer::resetBwd() { return; } if (getInput(0, MKLDNN_DEVICE).getAllCount() > 1) { - // TODO: many mkldnn bots - // add sum handle + // TODO(TJ): use outputMaps_ ways when merge topdiff done } else { inGrad_ = MKLDNNMatrix::create(in, inVal_->getPD()); } @@ -245,8 +243,7 @@ void MKLDNNFcLayer::resetBwd() { return; } if (getInput(0, CPU_DEVICE).getAllCount() > 1) { - // TODO: many bots - // add sum handle + // TODO(TJ): use outputMaps_ ways when merge topdiff done } else { inGrad_ = MKLDNNMatrix::create(in, inVal_->getPD()); } -- GitLab