Skip to content

Commit

Permalink
Modified the condition to load the optimiser model
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
heflinstephenraj authored Dec 20, 2023
1 parent 8931854 commit 5b36323
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion java/src/main/native/ai_onnxruntime_OrtTrainingSession.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 5b36323

Please sign in to comment.