Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions paddle/phi/kernels/impl/warpctc_kernel_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,22 +251,29 @@ void WarpctcKernel(const Context& dev_ctx,
"greater than zero "
"but received %d. ",
max_sequence_length));

PADDLE_ENFORCE_GT(num_sequences,
0,
common::errors::InvalidArgument(
"The second dimension of Input(Logits) should be "
"greater than zero "
"but received %d. ",
num_sequences));

PADDLE_ENFORCE_GT(sequence_width,
0,
common::errors::InvalidArgument(
"The third dimension of Input(Logits) should be "
"greater than zero "
"but received %d. ",
sequence_width));
PADDLE_ENFORCE_LT(
num_sequences * sequence_width * max_sequence_length,
std::numeric_limits<int>::max(),
errors::InvalidArgument(
"The total number of elements in Input(Logits) should be less than "
"%d, "
"but received %d",
std::numeric_limits<int>::max(),
num_sequences * sequence_width * max_sequence_length));

DenseTensor logits_length_cpu;
DenseTensor labels_length_cpu;
Expand Down
Loading