Skip to content

refine check macro#5154

Merged
luotao1 merged 1 commit intoPaddlePaddle:developfrom
tensor-tang:merge
Oct 27, 2017
Merged

refine check macro#5154
luotao1 merged 1 commit intoPaddlePaddle:developfrom
tensor-tang:merge

Conversation

@tensor-tang
Copy link
Contributor

fix #5113

@tensor-tang tensor-tang requested a review from luotao1 October 27, 2017 05:15
// 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 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

2 participants