未验证 提交 2ef97e68 编写于 作者: H hong19860320 提交者: GitHub

[NPU] Fix the compiling error caused by operators::ValidateShape() (#2876) (#2882)

上级 0699ee90
...@@ -73,8 +73,7 @@ int ReshapeConverter(void* ctx, OpLite* op, KernelBase* kernel) { ...@@ -73,8 +73,7 @@ int ReshapeConverter(void* ctx, OpLite* op, KernelBase* kernel) {
auto shape = auto shape =
std::vector<int>(actual_shape_data, std::vector<int>(actual_shape_data,
actual_shape_data + actual_shape_dims.production()); actual_shape_data + actual_shape_dims.production());
auto out_dims = lite::operators::ValidateShape(shape, x_dims); auto out_shape = lite::operators::ValidateShape(shape, x_dims);
auto out_shape = out_dims.Vectorize();
if (out_shape.size() > 4) { if (out_shape.size() > 4) {
LOG(WARNING) << "[NPU] HiAI DDK only supports less than 4 dimensions, " LOG(WARNING) << "[NPU] HiAI DDK only supports less than 4 dimensions, "
"but Shape has " "but Shape has "
...@@ -88,8 +87,7 @@ int ReshapeConverter(void* ctx, OpLite* op, KernelBase* kernel) { ...@@ -88,8 +87,7 @@ int ReshapeConverter(void* ctx, OpLite* op, KernelBase* kernel) {
reshape_op->set_input_w(*actual_shape_node->data()); reshape_op->set_input_w(*actual_shape_node->data());
} else { } else {
auto shape = op_info->GetAttr<std::vector<int>>("shape"); auto shape = op_info->GetAttr<std::vector<int>>("shape");
auto out_dims = lite::operators::ValidateShape(shape, x_dims); auto out_shape = lite::operators::ValidateShape(shape, x_dims);
auto out_shape = out_dims.Vectorize();
if (out_shape.size() > 4) { if (out_shape.size() > 4) {
LOG(WARNING) << "[NPU] HiAI DDK only supports less than 4 dimensions, " LOG(WARNING) << "[NPU] HiAI DDK only supports less than 4 dimensions, "
"but shape has " "but shape has "
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册