diff --git a/tf_adapter/util/npu_attrs.cc b/tf_adapter/util/npu_attrs.cc index 5e0725552afa03896b6c25f7830ef961d2dad83b..eead6faf3f77752e369fdb742df832031bc0324c 100644 --- a/tf_adapter/util/npu_attrs.cc +++ b/tf_adapter/util/npu_attrs.cc @@ -2410,7 +2410,8 @@ Status NpuAttrs::SetNpuOptimizerAttr(const GraphOptimizationPassOptions &options if (params.count("variable_placement") > 0) { variable_location = params.at("variable_placement").s(); } - if (params.count("export_compile_stat") > 0) { + if ((params.count("export_compile_stat") > 0) && + (params.at("export_compile_stat").value_case() == AttrValue::ValueCase::kI)) { export_compile_stat = params.at("export_compile_stat").i(); const static std::vector kExportCompileStatList = {0, 1, 2}; NPU_REQUIRES_OK(CheckValueAllowed(export_compile_stat, kExportCompileStatList));