Skip to content

Commit a0b7a07

Browse files
author
wanghaox
committed
fix some comments
2 parents 49a5942 + 069dcc2 commit a0b7a07

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

paddle/operators/sequence_slice_op.cc

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,14 @@ class SequenceSliceOp : public framework::OperatorWithKernel {
3535
auto offset_dim = ctx->GetInputDim("Offset");
3636
auto length_dim = ctx->GetInputDim("Length");
3737

38-
PADDLE_ENFORCE_EQ(offset_dim.size(), 2UL,
39-
"Only support one level sequence now.");
40-
PADDLE_ENFORCE_EQ(length_dim.size(), 2UL,
41-
"Only support one level sequence now.");
42-
38+
PADDLE_ENFORCE_EQ(
39+
offset_dim.size(), 2UL,
40+
"Only support one level sequence now, The rank of offset must be 2.");
41+
PADDLE_ENFORCE_EQ(
42+
length_dim.size(), 2UL,
43+
"Only support one level sequence now, The rank of Length must be 2.");
44+
45+
// Initialize the output's dims to maximum
4346
ctx->SetOutputDim("Out", input_dims);
4447
}
4548

paddle/operators/sequence_slice_op.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ class SequenceSliceOpKernel : public framework::OpKernel<T> {
5454
PADDLE_ENFORCE_EQ(lod.size(), 1UL,
5555
"Only support one level sequence now.");
5656
PADDLE_ENFORCE_EQ(
57-
n, length->dims()[0],
57+
n, static_cast<size_t>(length->dims()[0]),
5858
"The size of input-sequence and length-array should be the same")
5959
PADDLE_ENFORCE_EQ(
60-
n, offset->dims()[0],
60+
n, static_cast<size_t>(offset->dims()[0]),
6161
"The size of input-sequence and offset-array should be the same")
6262

6363
const int64_t* offset_data = offset->data<int64_t>();

0 commit comments

Comments
 (0)