diff --git a/csharp/test/Microsoft.ML.OnnxRuntime.Tests/InferenceTest.cs b/csharp/test/Microsoft.ML.OnnxRuntime.Tests/InferenceTest.cs index 3f940e45c0aef..148aeeeab953c 100644 --- a/csharp/test/Microsoft.ML.OnnxRuntime.Tests/InferenceTest.cs +++ b/csharp/test/Microsoft.ML.OnnxRuntime.Tests/InferenceTest.cs @@ -646,7 +646,7 @@ private void TestModelSerialization() // Set the optimized model file path to assert that no exception are thrown. SessionOptions options = new SessionOptions(); options.SetOptimizedModelFilePath(modelOutputPath); - options.SetSessionGraphOptimizationLevel(1); + options.SetSessionGraphOptimizationLevel(GraphOptimizationLevel.ORT_ENABLE_BASIC); var session = new InferenceSession(modelPath, options); Assert.NotNull(session); Assert.True(File.Exists(modelOutputPath));