提交 43c4a00d 编写于 作者: S smallv0221

API(Compute) error message enhancement on line 44, 50, 53.

上级 b6ecf356
...@@ -42,14 +42,17 @@ class SequencePoolKernel : public framework::OpKernel<T> { ...@@ -42,14 +42,17 @@ class SequencePoolKernel : public framework::OpKernel<T> {
"Input(X) Tensor of SequencePoolOp " "Input(X) Tensor of SequencePoolOp "
"does not contain LoD information.")); "does not contain LoD information."));
PADDLE_ENFORCE_LE(lod_level, 2UL, PADDLE_ENFORCE_LE(lod_level, 2UL,
"The lod level of input shall be no more than 2."); platform::errors::InvalidArgument(
"The lod level of input shall be no more than 2."));
PADDLE_ENFORCE_GE( PADDLE_ENFORCE_GE(
dims[0], dims[0],
/*batch size = */ static_cast<int64_t>(lod[lod_level - 1].size() - 1), /*batch size = */ static_cast<int64_t>(lod[lod_level - 1].size() - 1),
"The first dimension of Input(X) must be large than batch size."); platform::errors::InvalidArgument(
"The first dimension of Input(X) must be large than batch size."));
if (lod_level > 1UL) { if (lod_level > 1UL) {
PADDLE_ENFORCE_EQ(lod[0][lod[0].size() - 1], lod[1].size() - 1, PADDLE_ENFORCE_EQ(lod[0][lod[0].size() - 1], lod[1].size() - 1,
"The input lod information is illegal."); platform::errors::InvalidArgument(
"The input lod information is illegal."));
framework::LoD out_lod; framework::LoD out_lod;
out_lod.push_back(lod[0]); out_lod.push_back(lod[0]);
out->set_lod(out_lod); out->set_lod(out_lod);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册