From 37dc89e7d6bef7243018d83357885b627a689dd0 Mon Sep 17 00:00:00 2001 From: shentanyue Date: Tue, 28 Mar 2023 11:24:30 +0800 Subject: [PATCH] test=huawei_ascend_npu --- .../nnadapter/src/driver/huawei_ascend_npu/engine.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lite/backends/nnadapter/nnadapter/src/driver/huawei_ascend_npu/engine.cc b/lite/backends/nnadapter/nnadapter/src/driver/huawei_ascend_npu/engine.cc index 32d3ecb837b..6ed9d685ed9 100644 --- a/lite/backends/nnadapter/nnadapter/src/driver/huawei_ascend_npu/engine.cc +++ b/lite/backends/nnadapter/nnadapter/src/driver/huawei_ascend_npu/engine.cc @@ -18,6 +18,7 @@ #include "driver/huawei_ascend_npu/optimizer/fix_no_inputs_ops.h" #include "driver/huawei_ascend_npu/optimizer/fix_quantized_ops.h" #include "driver/huawei_ascend_npu/optimizer/fix_reduce_ops_scalar_output.h" +#include "optimizer/convert_adaptive_pool2d_into_pool2d.h" #include "optimizer/fuse_conv2d_activation_into_conv2d.h" #include "optimizer/fuse_conv2d_add_into_conv2d.h" #include "optimizer/fuse_conv2d_batch_norm_into_conv2d.h" @@ -238,6 +239,9 @@ int Program::Build(core::Model* model, core::Cache* cache) { FuseMatMulDequantAddIntoFullyConnectedDequant(model); FuseMatMulAddIntoFullyConnected(model, true); FuseReshapeTransposeReshapeIntoChannelShuffle(model); +#if NNADAPTER_HUAWEI_ASCEND_NPU_CANN_VERSION_GREATER_THAN(6, 0, 0) + ConvertAdaptivePool2dIntoPool2d(model); +#endif FixQuantizedOps(model); NNADAPTER_VLOG(5) << "Optimized model:" << std::endl << Visualize(model); // Convert a NNAdapter model to a GE graph