Skip to content

Commit

Permalink
call OrtClearBoundOutputs when release session
Browse files Browse the repository at this point in the history
  • Loading branch information
qjia7 committed Jan 29, 2024
1 parent 1beb3f1 commit 59f5f92
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion js/web/lib/wasm/wasm-core-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,12 @@ export const releaseSession = (sessionId: number): void => {
if (!session) {
throw new Error(`cannot release session. invalid session id: ${sessionId}`);
}
const [sessionHandle, inputNamesUTF8Encoded, outputNamesUTF8Encoded, ioBindingState] = session;
const [sessionHandle, inputNamesUTF8Encoded, outputNamesUTF8Encoded, ioBindingState, enableGraphCapture] = session;

if (ioBindingState) {
if (enableGraphCapture) {
wasm._OrtClearBoundOutputs(ioBindingState.handle);
}
wasm._OrtReleaseBinding(ioBindingState.handle);
}

Expand Down

0 comments on commit 59f5f92

Please sign in to comment.