diff --git a/lite/kernels/npu/bridges/reshape_op.cc b/lite/kernels/npu/bridges/reshape_op.cc index 50c7f9d65a94658f8670ac63e658656b982f4649..00aa4b3497dd0f9bebbfa31b0256250b30b40a30 100644 --- a/lite/kernels/npu/bridges/reshape_op.cc +++ b/lite/kernels/npu/bridges/reshape_op.cc @@ -73,8 +73,7 @@ int ReshapeConverter(void* ctx, OpLite* op, KernelBase* kernel) { auto shape = std::vector(actual_shape_data, actual_shape_data + actual_shape_dims.production()); - auto out_dims = lite::operators::ValidateShape(shape, x_dims); - auto out_shape = out_dims.Vectorize(); + auto out_shape = lite::operators::ValidateShape(shape, x_dims); if (out_shape.size() > 4) { LOG(WARNING) << "[NPU] HiAI DDK only supports less than 4 dimensions, " "but Shape has " @@ -88,8 +87,7 @@ int ReshapeConverter(void* ctx, OpLite* op, KernelBase* kernel) { reshape_op->set_input_w(*actual_shape_node->data()); } else { auto shape = op_info->GetAttr>("shape"); - auto out_dims = lite::operators::ValidateShape(shape, x_dims); - auto out_shape = out_dims.Vectorize(); + auto out_shape = lite::operators::ValidateShape(shape, x_dims); if (out_shape.size() > 4) { LOG(WARNING) << "[NPU] HiAI DDK only supports less than 4 dimensions, " "but shape has "