onnxruntime
Version:
Node.js binding of ONNXRuntime
33 lines (32 loc) • 1.27 kB
TypeScript
import { InferenceSession as InferenceSessionInterface } from './inference-session';
import { OnnxValue } from './onnx-value';
/**
* Binding exports a simple synchronized inference session object wrap.
*/
export declare namespace Binding {
interface InferenceSession {
loadModel(modelPath: string, options: InferenceSessionInterface.SessionOptions): void;
loadModel(buffer: ArrayBuffer, byteOffset: number, byteLength: number, options: InferenceSessionInterface.SessionOptions): void;
readonly inputNames: string[];
readonly outputNames: string[];
run(feeds: InferenceSession.FeedsType, fetches: InferenceSession.FetchesType, options: InferenceSession.RunOptions): InferenceSession.ReturnType;
}
namespace InferenceSession {
type FeedsType = {
[name: string]: OnnxValue;
};
type FetchesType = {
[name: string]: OnnxValue | null;
};
type ReturnType = {
[name: string]: OnnxValue;
};
type RunOptions = InferenceSessionInterface.RunOptions;
}
interface InferenceSessionConstructor {
new (): InferenceSession;
}
}
export declare const binding: {
InferenceSession: Binding.InferenceSessionConstructor;
};