diff --git a/tf_adapter/util/ge_plugin.cc b/tf_adapter/util/ge_plugin.cc index a74f3be574d4198780799ce4be9f692b85a1bcee..dbad404f2a8a54141e184f9090b263c41e0e9287 100644 --- a/tf_adapter/util/ge_plugin.cc +++ b/tf_adapter/util/ge_plugin.cc @@ -268,7 +268,10 @@ uint64_t GePlugin::GetFusionTensorSize() { return default_fusion_tensor_size; } std::string temp_fusion_tensor_size(env_fusion_tensor_size); - std::istringstream string_stream(temp_fusion_tensor_size); + std::istringstream string_stream; + if (!temp_fusion_tensor_size.empty()) { + string_stream.str(temp_fusion_tensor_size); + } uint64_t fusion_tensor_size = 0; if (!(string_stream >> fusion_tensor_size)) { fusion_tensor_size = default_fusion_tensor_size; diff --git a/tf_adapter_2.x/npu_device/core/npu_parser.h b/tf_adapter_2.x/npu_device/core/npu_parser.h index 8cc4ac61e51967aa64a7db24d4f5625710c1d8d4..484802f47b5c17e1a9bac0a8a6d2b5e28e5ed883 100644 --- a/tf_adapter_2.x/npu_device/core/npu_parser.h +++ b/tf_adapter_2.x/npu_device/core/npu_parser.h @@ -117,13 +117,13 @@ __attribute__((unused)) static void AssembleOpDef(tensorflow::Node *n) { n->AddAttr("op_def", serialized_op_def); } -static void AssembleOpDef(const tensorflow::OpRegistrationData *op_data, tensorflow::NodeDef *ndef) { +__attribute__((unused)) static void AssembleOpDef(const tensorflow::OpRegistrationData *op_data, tensorflow::NodeDef *ndef) { std::string serialized_op_def; op_data->op_def.SerializeToString(&serialized_op_def); tensorflow::AddNodeAttr("op_def", serialized_op_def, ndef); } -static void AssembleOpDef(tensorflow::NodeDef *ndef) { +__attribute__((unused)) static void AssembleOpDef(tensorflow::NodeDef *ndef) { const tensorflow::OpRegistrationData *op_reg_data; tensorflow::OpRegistry::Global()->LookUp(ndef->op(), &op_reg_data); std::string serialized_op_def;