From 138978baa630f557b292f3b9bbb6a7e7828baf9c Mon Sep 17 00:00:00 2001 From: cc <52520497+juncaipeng@users.noreply.github.com> Date: Thu, 14 May 2020 19:44:52 +0800 Subject: [PATCH] Fix bug in slice op when infer_flags is empyt, test=develop (#3625) --- lite/operators/slice_op.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lite/operators/slice_op.cc b/lite/operators/slice_op.cc index c18fc98941..9757015848 100644 --- a/lite/operators/slice_op.cc +++ b/lite/operators/slice_op.cc @@ -43,7 +43,7 @@ bool SliceOp::InferShapeImpl() const { CHECK_LT(param_.axes[i], in_dims.size()) << "The index of dimension in " "axes must be less than the " "size of input shape."; - if (param_.infer_flags[i] == -1) { + if (param_.infer_flags.size() > i && param_.infer_flags[i] == -1) { out_dims[axes[i]] = -1; } else { // infer out_dim shape -- GitLab