From 5b363236b75ae4acbcc7c4ecc90d2d7640ed5923 Mon Sep 17 00:00:00 2001 From: Heflin Stephen Raj Date: Wed, 20 Dec 2023 17:16:08 +0530 Subject: [PATCH] Modified the condition to load the optimiser model Since the condition is optimizerPath == NULL, the program control flow doesn't enter the if block. As a result, the value for optimizerStr is not set, and consequently, the optimizer model is not loaded. I have made the necessary changes to set the value for optimizerStr. --- java/src/main/native/ai_onnxruntime_OrtTrainingSession.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/src/main/native/ai_onnxruntime_OrtTrainingSession.c b/java/src/main/native/ai_onnxruntime_OrtTrainingSession.c index 9f7b8d3a3dcfc..464234c34798a 100644 --- a/java/src/main/native/ai_onnxruntime_OrtTrainingSession.c +++ b/java/src/main/native/ai_onnxruntime_OrtTrainingSession.c @@ -66,7 +66,7 @@ JNIEXPORT jlong JNICALL Java_ai_onnxruntime_OrtTrainingSession_createTrainingSes } } wchar_t* optimizerStr = NULL; - if (optimizerPath == NULL) { + if (optimizerPath != NULL) { optimizerStr = copyAndPad(jniEnv, optimizerPath); if (optimizerStr == NULL) { // exception has been thrown in Java, go to cleanup and return null.