Skip to content

Commit 1b82d83

Browse files
authored
[Fix] InterOpNumThreads Session Option for ONNX ReactNative Package (microsoft#21263)
### Description This PR resolves a bug related to setting the **interOpNumThreads** session option when creating an **ORTSession**. Currently, when the **interOpNumThreads** option is passed from React Native, the native module incorrectly sets **intraOpNumThreads** instead of **interOpNumThreads**. ### Motivation and Context Since this is a bug, users of the Onnx React Native package may believe that they are setting **interOpNumThreads** correctly, So this change is required. Refer to the code snippet below for details <img width="634" alt="Screenshot 2024-07-05 at 9 28 58 PM" src="https://github.com/microsoft/onnxruntime/assets/88655321/70a8f216-553a-4f4c-9481-e6871f0e37e6">
1 parent 1b19045 commit 1b82d83

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

js/react_native/android/src/main/java/ai/onnxruntime/reactnative/OnnxruntimeModule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ private SessionOptions parseSessionOptions(ReadableMap options) throws OrtExcept
349349
if (options.hasKey("interOpNumThreads")) {
350350
int interOpNumThreads = options.getInt("interOpNumThreads");
351351
if (interOpNumThreads > 0 && interOpNumThreads < Integer.MAX_VALUE) {
352-
sessionOptions.setIntraOpNumThreads(interOpNumThreads);
352+
sessionOptions.setInterOpNumThreads(interOpNumThreads);
353353
}
354354
}
355355

0 commit comments

Comments
 (0)