未验证 提交 f6d39083 编写于 作者: S smallv0221 提交者: GitHub

Update sequence_conv_op.cc

上级 31fee180
......@@ -68,12 +68,15 @@ class SequenceConvOp : public framework::OperatorWithKernel {
int down_pad = std::max(0, context_start + context_length - 1);
int total_pad = up_pad + down_pad;
int input_width = static_cast<int>(in_dims[1]);
bool start_equals_zero = context_start == 0;
bool length_equals_one = context_length == 1;
bool start_length = start_equals_zero && length_equals_one;
if (context_start == 0 && context_length == 1) {
PADDLE_THROW(platform::errors::InvalidArgument(
"If context_start is 0 and context_length is 1, paddingTrainable "
"should be false."));
}
PADDLE_ENFORCE_EQ(
start_length, false,
platform::errors::InvalidArgument(
"If context_start is 0 and context_length is 1, paddingTrainable "
"should be false."));
PADDLE_ENFORCE_EQ(
padding_dim.size(), 2,
platform::errors::InvalidArgument(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册