diff --git a/include/onnxruntime/core/graph/graph.h b/include/onnxruntime/core/graph/graph.h index 70181364b066a..7798394b045dc 100644 --- a/include/onnxruntime/core/graph/graph.h +++ b/include/onnxruntime/core/graph/graph.h @@ -1519,7 +1519,7 @@ class Graph { // NOLINT(clang-analyzer-optin.performance.Padding): preserve exi /// external file stream /// current external file offset updated with each write /// Status instance - Status ToGraphProtoWithExternalInitiallizersImpl( + Status AddExternalInitializersToGraphProtoImpl( const std::filesystem::path& model_path, const std::filesystem::path& external_file_path, const std::filesystem::path& model_external_file_path, diff --git a/onnxruntime/core/framework/prepacked_weights_container.cc b/onnxruntime/core/framework/prepacked_weights_container.cc index 91872479ae8d8..7c832a0ac2691 100644 --- a/onnxruntime/core/framework/prepacked_weights_container.cc +++ b/onnxruntime/core/framework/prepacked_weights_container.cc @@ -87,11 +87,11 @@ const PrePackedWeights* PrepackedWeightsForGraph::GetPrepackedWeights(const std: std::optional PrepackedWeightsForGraph::ReplaceWithReferenceIfSaving( const std::string& weight_name, const std::string& key, - const PrePackedWeights& refer_if_absent) { + const PrePackedWeights& refer_to_if_absent) { auto it = key_to_blobs_.find(key); if (it == key_to_blobs_.end()) { if (save_mode_on_) { - key_to_blobs_.emplace(key, refer_if_absent.CreateReferringCopy()); + key_to_blobs_.emplace(key, refer_to_if_absent.CreateReferringCopy()); weight_prepacks_for_saving_[weight_name].insert(key); } return std::nullopt; diff --git a/onnxruntime/core/framework/prepacked_weights_container.h b/onnxruntime/core/framework/prepacked_weights_container.h index 742b3bcca874b..f48c790eb4126 100644 --- a/onnxruntime/core/framework/prepacked_weights_container.h +++ b/onnxruntime/core/framework/prepacked_weights_container.h @@ -119,7 +119,7 @@ class PrepackedWeightsForGraph { // the container. std::optional ReplaceWithReferenceIfSaving(const std::string& weight_name, const std::string& key, - const PrePackedWeights& refer_if_absent); + const PrePackedWeights& refer_to_if_absent); bool IsSaveModeOn() const noexcept { return save_mode_on_; diff --git a/onnxruntime/core/graph/graph.cc b/onnxruntime/core/graph/graph.cc index 51ecdf50efd51..0b6610db5e007 100644 --- a/onnxruntime/core/graph/graph.cc +++ b/onnxruntime/core/graph/graph.cc @@ -4097,7 +4097,7 @@ ONNX_NAMESPACE::GraphProto Graph::ToGraphProto() const { return result; } -Status Graph::ToGraphProtoWithExternalInitiallizersImpl( +Status Graph::AddExternalInitializersToGraphProtoImpl( const std::filesystem::path& model_path, const std::filesystem::path& external_file_path, const std::filesystem::path& model_external_file_path, @@ -4134,7 +4134,7 @@ Status Graph::ToGraphProtoWithExternalInitiallizersImpl( "Subgraph ", name, " is referred to in GetAttributeNameToSubgraphMap, but not found in node ", node.Name(), " while attempting to recurse into it."); auto& result_subgraph = *sub_hit->mutable_g(); - ORT_RETURN_IF_ERROR(subgraph->ToGraphProtoWithExternalInitiallizersImpl( + ORT_RETURN_IF_ERROR(subgraph->AddExternalInitializersToGraphProtoImpl( model_path, external_file_path, model_external_file_path, model_saving_options, result_subgraph, @@ -4261,10 +4261,10 @@ ONNX_NAMESPACE::GraphProto Graph::ToGraphProtoWithExternalInitializers( ORT_ENFORCE(external_stream.is_open(), "Failed to open for writing:", modified_external_file_path); int64_t external_offset = 0; - ORT_THROW_IF_ERROR(ToGraphProtoWithExternalInitiallizersImpl(model_path, external_file_path, - modified_external_file_path, model_saving_options, - result, - external_stream, external_offset)); + ORT_THROW_IF_ERROR(AddExternalInitializersToGraphProtoImpl(model_path, external_file_path, + modified_external_file_path, model_saving_options, + result, + external_stream, external_offset)); if (!external_stream.flush()) { ORT_THROW("Failed to flush file with external initializers: ", modified_external_file_path);