mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-26 19:52:38 +00:00
[js] allow manually release inference session (#16169)
### Description This change adds a new instance function (method) to type `InferenceSession` to allow users to manually release an inference session instance. #16131 depends on this change to work correctly.
This commit is contained in:
parent
3dc5179a36
commit
ba5f5e3198
2 changed files with 13 additions and 0 deletions
|
|
@ -115,6 +115,10 @@ export class InferenceSession implements InferenceSessionInterface {
|
|||
return returnValue;
|
||||
}
|
||||
|
||||
async release(): Promise<void> {
|
||||
return this.handler.dispose();
|
||||
}
|
||||
|
||||
static create(path: string, options?: SessionOptions): Promise<InferenceSessionInterface>;
|
||||
static create(buffer: ArrayBufferLike, options?: SessionOptions): Promise<InferenceSessionInterface>;
|
||||
static create(buffer: ArrayBufferLike, byteOffset: number, byteLength?: number, options?: SessionOptions):
|
||||
|
|
|
|||
|
|
@ -306,6 +306,15 @@ export interface InferenceSession {
|
|||
|
||||
// #endregion
|
||||
|
||||
// #region release()
|
||||
|
||||
/**
|
||||
* Release the inference session and the underlying resources.
|
||||
*/
|
||||
release(): Promise<void>;
|
||||
|
||||
// #endregion
|
||||
|
||||
// #region profiling
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue