diff --git a/include/onnxruntime/core/graph/graph.h b/include/onnxruntime/core/graph/graph.h index 2830a4878fa76..70181364b066a 100644 --- a/include/onnxruntime/core/graph/graph.h +++ b/include/onnxruntime/core/graph/graph.h @@ -1367,6 +1367,11 @@ class Graph { // NOLINT(clang-analyzer-optin.performance.Padding): preserve exi return outer_scope_node_arg_names_; } + common::Status SaveToOrtFormat(flatbuffers::FlatBufferBuilder& builder, + flatbuffers::Offset& fbs_graph) const; + +#endif // !defined(ORT_MINIMAL_BUILD) + // This function constructs PrepackedSharedContainer in the root graph only // and initializes a reference to it in all (sub)graphs void ConstructPrepackedSharedContainerAndSetMode(bool saving_mode_on); @@ -1379,11 +1384,6 @@ class Graph { // NOLINT(clang-analyzer-optin.performance.Padding): preserve exi return *prepacked_weights_for_graph_; } - common::Status SaveToOrtFormat(flatbuffers::FlatBufferBuilder& builder, - flatbuffers::Offset& fbs_graph) const; - -#endif // !defined(ORT_MINIMAL_BUILD) - /** Returns the Node containing the GraphProto for this Graph instance if IsSubgraph is true */ const Node* ParentNode() const { return parent_node_; } diff --git a/onnxruntime/test/framework/session_state_test.cc b/onnxruntime/test/framework/session_state_test.cc index b6cc58bd0784c..7bb0d4a5650ea 100644 --- a/onnxruntime/test/framework/session_state_test.cc +++ b/onnxruntime/test/framework/session_state_test.cc @@ -30,6 +30,7 @@ using namespace ONNX_NAMESPACE; namespace onnxruntime { namespace test { +#ifndef ENABLE_TRAINING_CORE #ifndef __wasm__ // This specialization is used by SessionStateTestSharedInitalizersWithPrePacking.TestPrepackedSerialization down below // to be called on the main graph @@ -117,6 +118,7 @@ static void TestLoadedSharedNoUserSupplied(const Model& model) { } #endif // __wasm__ +#endif // ENABLE_TRAINING_CORE class TestOpKernel : public OpKernel { public: