File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -35,11 +35,14 @@ class SequenceSliceOp : public framework::OperatorWithKernel {
35
35
auto offset_dim = ctx->GetInputDim (" Offset" );
36
36
auto length_dim = ctx->GetInputDim (" Length" );
37
37
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
43
46
ctx->SetOutputDim (" Out" , input_dims);
44
47
}
45
48
Original file line number Diff line number Diff line change @@ -54,10 +54,10 @@ class SequenceSliceOpKernel : public framework::OpKernel<T> {
54
54
PADDLE_ENFORCE_EQ (lod.size (), 1UL ,
55
55
" Only support one level sequence now." );
56
56
PADDLE_ENFORCE_EQ (
57
- n, length->dims ()[0 ],
57
+ n, static_cast < size_t >( length->dims ()[0 ]) ,
58
58
" The size of input-sequence and length-array should be the same" )
59
59
PADDLE_ENFORCE_EQ (
60
- n, offset->dims ()[0 ],
60
+ n, static_cast < size_t >( offset->dims ()[0 ]) ,
61
61
" The size of input-sequence and offset-array should be the same" )
62
62
63
63
const int64_t * offset_data = offset->data <int64_t >();
You can’t perform that action at this time.
0 commit comments