Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refine check macro #5154

Merged
merged 1 commit into from
Oct 27, 2017
Merged

refine check macro #5154

merged 1 commit into from
Oct 27, 2017

Conversation

tensor-tang
Copy link
Contributor

fix #5113

auto md = in->getMemoryDesc();
auto bwdDesc = bn_bwd::desc(prop_kind::backward, md, md, EPS, flags_);
pd.reset(new bn_bwd::primitive_desc(bwdDesc, engine_, *fwdPD_));
// TODO(TJ): use check macro
CHECK(wgt);
CHECK(wgt->getPrimitiveDesc() == pd->diff_weights_primitive_desc());
CHECK(pd->weights_primitive_desc() == fwdPD_->weights_primitive_desc());
Copy link
Contributor

Choose a reason for hiding this comment

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

CHECK_EQ(pd->weights_primitive_desc() , fwdPD_->weights_primitive_desc());
用CHECK_EQ更规范点。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这个我之前试过用CHECK_EQ,但是编译会报错的。可能是操作符的事情,所以就用==了。

CHECK_PRIMITIVE_DESC_EQ(
outVal_,
pd->diff_dst_primitive_desc(),
"primitive desc of out value and grad should be equal");
Copy link
Contributor

Choose a reason for hiding this comment

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

CHECK_PRIMITIVE_DESC_EQ 会打印出LOG,这里还需要另外加么?
265行没加,269行为什么要加呢?下面有些地方也没加。
可以全部都去掉么,这样更加简洁。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

嗯,是特意留的一个参数,主要是有些地方需要特别备注下。

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 c1fd1dc into PaddlePaddle:develop Oct 27, 2017
@tensor-tang tensor-tang moved this from Doing to Done in Optimization on Intel Platform Oct 27, 2017
@tensor-tang tensor-tang deleted the merge branch October 27, 2017 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

refine CHECK Macro
2 participants