mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-29 20:14:01 +00:00
[Fix] InterOpNumThreads Session Option for ONNX ReactNative Package (#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">
This commit is contained in:
parent
1b19045afa
commit
1b82d835d8
1 changed files with 1 additions and 1 deletions
|
|
@ -349,7 +349,7 @@ public class OnnxruntimeModule extends ReactContextBaseJavaModule implements Lif
|
|||
if (options.hasKey("interOpNumThreads")) {
|
||||
int interOpNumThreads = options.getInt("interOpNumThreads");
|
||||
if (interOpNumThreads > 0 && interOpNumThreads < Integer.MAX_VALUE) {
|
||||
sessionOptions.setIntraOpNumThreads(interOpNumThreads);
|
||||
sessionOptions.setInterOpNumThreads(interOpNumThreads);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue