未验证 提交 be82de4c 编写于 作者: C Chen Weihang 提交者: GitHub

polish two error message, test=develop (#24778)

上级 5a7a517c
......@@ -33,12 +33,17 @@ class SequenceSoftmaxCUDNNKernel : public framework::OpKernel<T> {
auto& dims = x->dims();
const size_t level = lod.size() - 1;
PADDLE_ENFORCE_EQ(dims[0], static_cast<int64_t>(lod[level].back()),
"The first dimension of Input(X) should be equal to the "
"sum of all sequences' lengths.");
PADDLE_ENFORCE_EQ(
dims[0], static_cast<int64_t>(lod[level].back()),
platform::errors::InvalidArgument(
"The first dimension of Input(X) should be equal to the sum of all "
"sequences' lengths. But received first dimension of Input(X) is "
"%d, the sum of all sequences' lengths is %d.",
dims[0], static_cast<int64_t>(lod[level].back())));
PADDLE_ENFORCE_EQ(dims[0], x->numel(),
"The width of each timestep in Input(X) of "
"SequenceSoftmaxOp should be 1.");
platform::errors::InvalidArgument(
"The width of each timestep in Input(X) of "
"SequenceSoftmaxOp should be 1."));
out->mutable_data<T>(ctx.GetPlace());
for (int i = 0; i < static_cast<int>(lod[level].size()) - 1; ++i) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册