File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,20 @@ class StridedSliceOp : public framework::OperatorWithKernel {
6262 auto ends_size = ends.size ();
6363 auto strides_size = strides.size ();
6464
65+ for (size_t i = 0 ; i < axes.size (); ++i) {
66+ PADDLE_ENFORCE_GE (axes[i], 0 ,
67+ platform::errors::InvalidArgument (
68+ " The axis should be greater than or equal to 0."
69+ " But received %d of axes[%d]" ,
70+ axes[i], i));
71+ PADDLE_ENFORCE_LT (
72+ axes[i], in_dims.size (),
73+ platform::errors::InvalidArgument (
74+ " The axes should be less than or equal to input tensor's rank."
75+ " But received %d of axes[%d], input tensor shape [%d]" ,
76+ axes[i], i, in_dims.size ()));
77+ }
78+
6579 if (ctx->HasInputs (" StartsTensorList" )) {
6680 auto StartsTensorList = ctx->Inputs (" StartsTensorList" );
6781 PADDLE_ENFORCE_GT (
You can’t perform that action at this time.
0 commit comments