Skip to content

Comments

Refine MKLDNNMatrix and MKLDNNLayer#4008

Merged
luotao1 merged 3 commits intoPaddlePaddle:developfrom
tensor-tang:refine
Sep 11, 2017
Merged

Refine MKLDNNMatrix and MKLDNNLayer#4008
luotao1 merged 3 commits intoPaddlePaddle:developfrom
tensor-tang:refine

Conversation

@tensor-tang
Copy link
Contributor

@tensor-tang tensor-tang commented Sep 11, 2017

First PR of #3974

}
real* iData = getInputValue(0, CPU_DEVICE)->getData();
inVal_->setData(iData);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updateInputData这个函数,不同的mkldnn layer的处理方式会不一样么?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

处理方式是一样的,但是可能别的layer不是用inVal_了

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果处理方式是一样的,那updateInputData的实现应该放在MKLDNNLayer中:

void MKLDNNLayer::updateInputData(MKLDNNMatrix* val) {
   if (inputLayers_[0]->getType() != "data") {
     return;
   }
   real* iData = getInputValue(0, CPU_DEVICE)->getData();
   val->setData(iData);
 }

这里,updateInputData(inVal_)即可。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嗯,是的。不过我准备下一个PR,把这个函数放到父类,所以下一个一起改掉吧

Copy link
Contributor

@luotao1 luotao1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@luotao1 luotao1 merged commit faf827b into PaddlePaddle:develop Sep 11, 2017
@tensor-tang tensor-tang deleted the refine branch September 11, 2017 08:07
@tensor-tang
Copy link
Contributor Author

Some addition refer to #4011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants