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

v1.8
Chen Weihang 5 years ago committed by GitHub
parent 5a7a517cde
commit be82de4c79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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) {

Loading…
Cancel
Save