-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
refine check macro #5154
Conversation
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()); |
There was a problem hiding this comment.
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更规范点。
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
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行为什么要加呢?下面有些地方也没加。
可以全部都去掉么,这样更加简洁。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
嗯,是特意留的一个参数,主要是有些地方需要特别备注下。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
fix #5113