diff --git a/lite/kernels/npu/bridges/batch_norm_op.cc b/lite/kernels/npu/bridges/batch_norm_op.cc index d151fd8d7b35483f41190ecc789844a99e1f72de..d0e97161c5f1bc6b126e81b969a4564b47da9331 100644 --- a/lite/kernels/npu/bridges/batch_norm_op.cc +++ b/lite/kernels/npu/bridges/batch_norm_op.cc @@ -64,7 +64,11 @@ int BatchNormConverter(void* ctx, OpLite* op, KernelBase* kernel) { float momentum = op_info->GetAttr("momentum"); float epsilon = op_info->GetAttr("epsilon"); int mode = 1; // bnScale, bnBias tensor dims are 1xCx1x1 - bool use_global_stats = op_info->GetAttr("use_global_stats"); + bool use_global_stats = !op_info->HasAttr("use_global_stats") || + op_info->GetAttr("use_global_stats"); + if (!use_global_stats) { + LOG(WARNING) << "[NPU] Only use_global_stats=true is supported by HiAI DDK"; + } // X node std::shared_ptr x_node = nullptr; diff --git a/lite/kernels/npu/bridges/pool_op.cc b/lite/kernels/npu/bridges/pool_op.cc index 42349d18398b2f95003c859b15a32b707f97742a..ee90d81e508dabf58b9c2525ae6cb429aef332a5 100644 --- a/lite/kernels/npu/bridges/pool_op.cc +++ b/lite/kernels/npu/bridges/pool_op.cc @@ -61,8 +61,10 @@ int PoolConverter(void* ctx, OpLite* op, KernelBase* kernel) { mode = 0; } else if (pooling_type == "avg") { mode = 1; - CHECK(op_info->GetAttr("exclusive")) - << "[NPU] exclusive must be true in HiAI DDK"; + if (!op_info->GetAttr("exclusive")) { + LOG(WARNING) << "[NPU] Only exclusive=true is supported for the pooling " + "type 'avg' by HiAI DDK"; + } } else { LOG(WARNING) << "[NPU] Unsupported pooling type: " << pooling_type; return FAILED;