-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
46da32c
commit f0c4014
Showing
2 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
declare module 'onnxruntime-node' { | ||
export * from 'onnxruntime-common'; | ||
export { listSupportedBackends } from './backend'; | ||
|
||
import { Backend, InferenceSession, InferenceSessionHandler } from 'onnxruntime-common'; | ||
import { Binding } from './binding'; | ||
declare class OnnxruntimeBackend implements Backend { | ||
init(): Promise<void>; | ||
createInferenceSessionHandler(pathOrBuffer: string | Uint8Array, options?: InferenceSession.SessionOptions): Promise<InferenceSessionHandler>; | ||
} | ||
export declare const onnxruntimeBackend: OnnxruntimeBackend; | ||
export declare const listSupportedBackends: () => Binding.SupportedBackend[]; | ||
export {}; | ||
|
||
import { InferenceSession, OnnxValue } from 'onnxruntime-common'; | ||
type SessionOptions = InferenceSession.SessionOptions; | ||
type FeedsType = { | ||
[name: string]: OnnxValue; | ||
}; | ||
type FetchesType = { | ||
[name: string]: OnnxValue | null; | ||
}; | ||
type ReturnType = { | ||
[name: string]: OnnxValue; | ||
}; | ||
type RunOptions = InferenceSession.RunOptions; | ||
/** | ||
* Binding exports a simple synchronized inference session object wrap. | ||
*/ | ||
export declare namespace Binding { | ||
interface InferenceSession { | ||
loadModel(modelPath: string, options: SessionOptions): void; | ||
loadModel(buffer: ArrayBuffer, byteOffset: number, byteLength: number, options: SessionOptions): void; | ||
readonly inputNames: string[]; | ||
readonly outputNames: string[]; | ||
run(feeds: FeedsType, fetches: FetchesType, options: RunOptions): ReturnType; | ||
dispose(): void; | ||
} | ||
interface InferenceSessionConstructor { | ||
new (): InferenceSession; | ||
} | ||
interface SupportedBackend { | ||
name: string; | ||
bundled: boolean; | ||
} | ||
} | ||
export declare const binding: { | ||
InferenceSession: Binding.InferenceSessionConstructor; | ||
listSupportedBackends: () => Binding.SupportedBackend[]; | ||
}; | ||
export {}; | ||
export declare const version = '1.18.0'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"license": "MIT", | ||
"type": "module", | ||
"name": "onnxruntime-common", | ||
"version": "1.18.0", | ||
"repository": { | ||
"url": "https://github.com/Microsoft/onnxruntime.git", | ||
"type": "git" | ||
}, | ||
"author": "fs-eire", | ||
"scripts": { | ||
"build:cjs": "tsc --module commonjs --moduleResolution node10 --outDir ./dist/cjs", | ||
"build:esm": "tsc", | ||
"build:bundles": "webpack", | ||
"build": "node ./build.js", | ||
"prepare": "npm run build", | ||
"pretest": "tsc --build ./test", | ||
"test": "mocha ./test/**/*.js --timeout 30000" | ||
}, | ||
"devDependencies": { | ||
"typedoc": "^0.25.7" | ||
}, | ||
"main": "dist/cjs/index.js", | ||
"keywords": [ | ||
"ONNX", | ||
"ONNXRuntime", | ||
"ONNX Runtime" | ||
], | ||
"description": "ONNXRuntime JavaScript API library" | ||
} |