onnxruntime-node 1.11.0-dev.20220217-8d06e5a9d → 1.11.0-dev.20220318-b713855a9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/__commit.txt CHANGED
@@ -1 +1 @@
1
- 8d06e5a9df3024dbaadf4e221812d2fd46faabcd
1
+ b713855a980056d89a1e550ad81dc3c19573d7a0
package/dist/backend.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { Backend, InferenceSession, SessionHandler } from 'onnxruntime-common';
2
- declare class OnnxruntimeBackend implements Backend {
3
- init(): Promise<void>;
4
- createSessionHandler(pathOrBuffer: string | Uint8Array, options?: InferenceSession.SessionOptions): Promise<SessionHandler>;
5
- }
6
- export declare const onnxruntimeBackend: OnnxruntimeBackend;
7
- export {};
1
+ import { Backend, InferenceSession, SessionHandler } from 'onnxruntime-common';
2
+ declare class OnnxruntimeBackend implements Backend {
3
+ init(): Promise<void>;
4
+ createSessionHandler(pathOrBuffer: string | Uint8Array, options?: InferenceSession.SessionOptions): Promise<SessionHandler>;
5
+ }
6
+ export declare const onnxruntimeBackend: OnnxruntimeBackend;
7
+ export {};
package/dist/backend.js CHANGED
@@ -1,77 +1,77 @@
1
- "use strict";
2
- // Copyright (c) Microsoft Corporation. All rights reserved.
3
- // Licensed under the MIT License.
4
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) {
5
- if (!privateMap.has(receiver)) {
6
- throw new TypeError("attempted to set private field on non-instance");
7
- }
8
- privateMap.set(receiver, value);
9
- return value;
10
- };
11
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) {
12
- if (!privateMap.has(receiver)) {
13
- throw new TypeError("attempted to get private field on non-instance");
14
- }
15
- return privateMap.get(receiver);
16
- };
17
- var _inferenceSession;
18
- Object.defineProperty(exports, "__esModule", { value: true });
19
- exports.onnxruntimeBackend = void 0;
20
- const binding_1 = require("./binding");
21
- class OnnxruntimeSessionHandler {
22
- constructor(pathOrBuffer, options) {
23
- _inferenceSession.set(this, void 0);
24
- __classPrivateFieldSet(this, _inferenceSession, new binding_1.binding.InferenceSession());
25
- if (typeof pathOrBuffer === 'string') {
26
- __classPrivateFieldGet(this, _inferenceSession).loadModel(pathOrBuffer, options);
27
- }
28
- else {
29
- __classPrivateFieldGet(this, _inferenceSession).loadModel(pathOrBuffer.buffer, pathOrBuffer.byteOffset, pathOrBuffer.byteLength, options);
30
- }
31
- this.inputNames = __classPrivateFieldGet(this, _inferenceSession).inputNames;
32
- this.outputNames = __classPrivateFieldGet(this, _inferenceSession).outputNames;
33
- }
34
- async dispose() {
35
- return Promise.resolve();
36
- }
37
- startProfiling() {
38
- // TODO: implement profiling
39
- }
40
- endProfiling() {
41
- // TODO: implement profiling
42
- }
43
- async run(feeds, fetches, options) {
44
- return new Promise((resolve, reject) => {
45
- process.nextTick(() => {
46
- try {
47
- resolve(__classPrivateFieldGet(this, _inferenceSession).run(feeds, fetches, options));
48
- }
49
- catch (e) {
50
- // reject if any error is thrown
51
- reject(e);
52
- }
53
- });
54
- });
55
- }
56
- }
57
- _inferenceSession = new WeakMap();
58
- class OnnxruntimeBackend {
59
- async init() {
60
- return Promise.resolve();
61
- }
62
- async createSessionHandler(pathOrBuffer, options) {
63
- return new Promise((resolve, reject) => {
64
- process.nextTick(() => {
65
- try {
66
- resolve(new OnnxruntimeSessionHandler(pathOrBuffer, options || {}));
67
- }
68
- catch (e) {
69
- // reject if any error is thrown
70
- reject(e);
71
- }
72
- });
73
- });
74
- }
75
- }
76
- exports.onnxruntimeBackend = new OnnxruntimeBackend();
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation. All rights reserved.
3
+ // Licensed under the MIT License.
4
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) {
5
+ if (!privateMap.has(receiver)) {
6
+ throw new TypeError("attempted to set private field on non-instance");
7
+ }
8
+ privateMap.set(receiver, value);
9
+ return value;
10
+ };
11
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) {
12
+ if (!privateMap.has(receiver)) {
13
+ throw new TypeError("attempted to get private field on non-instance");
14
+ }
15
+ return privateMap.get(receiver);
16
+ };
17
+ var _inferenceSession;
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.onnxruntimeBackend = void 0;
20
+ const binding_1 = require("./binding");
21
+ class OnnxruntimeSessionHandler {
22
+ constructor(pathOrBuffer, options) {
23
+ _inferenceSession.set(this, void 0);
24
+ __classPrivateFieldSet(this, _inferenceSession, new binding_1.binding.InferenceSession());
25
+ if (typeof pathOrBuffer === 'string') {
26
+ __classPrivateFieldGet(this, _inferenceSession).loadModel(pathOrBuffer, options);
27
+ }
28
+ else {
29
+ __classPrivateFieldGet(this, _inferenceSession).loadModel(pathOrBuffer.buffer, pathOrBuffer.byteOffset, pathOrBuffer.byteLength, options);
30
+ }
31
+ this.inputNames = __classPrivateFieldGet(this, _inferenceSession).inputNames;
32
+ this.outputNames = __classPrivateFieldGet(this, _inferenceSession).outputNames;
33
+ }
34
+ async dispose() {
35
+ return Promise.resolve();
36
+ }
37
+ startProfiling() {
38
+ // TODO: implement profiling
39
+ }
40
+ endProfiling() {
41
+ // TODO: implement profiling
42
+ }
43
+ async run(feeds, fetches, options) {
44
+ return new Promise((resolve, reject) => {
45
+ process.nextTick(() => {
46
+ try {
47
+ resolve(__classPrivateFieldGet(this, _inferenceSession).run(feeds, fetches, options));
48
+ }
49
+ catch (e) {
50
+ // reject if any error is thrown
51
+ reject(e);
52
+ }
53
+ });
54
+ });
55
+ }
56
+ }
57
+ _inferenceSession = new WeakMap();
58
+ class OnnxruntimeBackend {
59
+ async init() {
60
+ return Promise.resolve();
61
+ }
62
+ async createSessionHandler(pathOrBuffer, options) {
63
+ return new Promise((resolve, reject) => {
64
+ process.nextTick(() => {
65
+ try {
66
+ resolve(new OnnxruntimeSessionHandler(pathOrBuffer, options || {}));
67
+ }
68
+ catch (e) {
69
+ // reject if any error is thrown
70
+ reject(e);
71
+ }
72
+ });
73
+ });
74
+ }
75
+ }
76
+ exports.onnxruntimeBackend = new OnnxruntimeBackend();
77
77
  //# sourceMappingURL=backend.js.map
package/dist/binding.d.ts CHANGED
@@ -1,31 +1,31 @@
1
- import { InferenceSession, OnnxValue } from 'onnxruntime-common';
2
- declare type SessionOptions = InferenceSession.SessionOptions;
3
- declare type FeedsType = {
4
- [name: string]: OnnxValue;
5
- };
6
- declare type FetchesType = {
7
- [name: string]: OnnxValue | null;
8
- };
9
- declare type ReturnType = {
10
- [name: string]: OnnxValue;
11
- };
12
- declare type RunOptions = InferenceSession.RunOptions;
13
- /**
14
- * Binding exports a simple synchronized inference session object wrap.
15
- */
16
- export declare namespace Binding {
17
- interface InferenceSession {
18
- loadModel(modelPath: string, options: SessionOptions): void;
19
- loadModel(buffer: ArrayBuffer, byteOffset: number, byteLength: number, options: SessionOptions): void;
20
- readonly inputNames: string[];
21
- readonly outputNames: string[];
22
- run(feeds: FeedsType, fetches: FetchesType, options: RunOptions): ReturnType;
23
- }
24
- interface InferenceSessionConstructor {
25
- new (): InferenceSession;
26
- }
27
- }
28
- export declare const binding: {
29
- InferenceSession: Binding.InferenceSessionConstructor;
30
- };
31
- export {};
1
+ import { InferenceSession, OnnxValue } from 'onnxruntime-common';
2
+ declare type SessionOptions = InferenceSession.SessionOptions;
3
+ declare type FeedsType = {
4
+ [name: string]: OnnxValue;
5
+ };
6
+ declare type FetchesType = {
7
+ [name: string]: OnnxValue | null;
8
+ };
9
+ declare type ReturnType = {
10
+ [name: string]: OnnxValue;
11
+ };
12
+ declare type RunOptions = InferenceSession.RunOptions;
13
+ /**
14
+ * Binding exports a simple synchronized inference session object wrap.
15
+ */
16
+ export declare namespace Binding {
17
+ interface InferenceSession {
18
+ loadModel(modelPath: string, options: SessionOptions): void;
19
+ loadModel(buffer: ArrayBuffer, byteOffset: number, byteLength: number, options: SessionOptions): void;
20
+ readonly inputNames: string[];
21
+ readonly outputNames: string[];
22
+ run(feeds: FeedsType, fetches: FetchesType, options: RunOptions): ReturnType;
23
+ }
24
+ interface InferenceSessionConstructor {
25
+ new (): InferenceSession;
26
+ }
27
+ }
28
+ export declare const binding: {
29
+ InferenceSession: Binding.InferenceSessionConstructor;
30
+ };
31
+ export {};
package/dist/binding.js CHANGED
@@ -1,10 +1,10 @@
1
- "use strict";
2
- // Copyright (c) Microsoft Corporation. All rights reserved.
3
- // Licensed under the MIT License.
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.binding = void 0;
6
- // export native binding
7
- exports.binding =
8
- // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
9
- require(`../bin/napi-v3/${process.platform}/${process.arch}/onnxruntime_binding.node`);
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation. All rights reserved.
3
+ // Licensed under the MIT License.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.binding = void 0;
6
+ // export native binding
7
+ exports.binding =
8
+ // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
9
+ require(`../bin/napi-v3/${process.platform}/${process.arch}/onnxruntime_binding.node`);
10
10
  //# sourceMappingURL=binding.js.map
package/dist/index.d.ts CHANGED
@@ -1 +1 @@
1
- export * from 'onnxruntime-common';
1
+ export * from 'onnxruntime-common';
package/dist/index.js CHANGED
@@ -1,19 +1,19 @@
1
- "use strict";
2
- // Copyright (c) Microsoft Corporation. All rights reserved.
3
- // Licensed under the MIT License.
4
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
- if (k2 === undefined) k2 = k;
6
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
7
- }) : (function(o, m, k, k2) {
8
- if (k2 === undefined) k2 = k;
9
- o[k2] = m[k];
10
- }));
11
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
12
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- __exportStar(require("onnxruntime-common"), exports);
16
- const onnxruntime_common_1 = require("onnxruntime-common");
17
- const backend_1 = require("./backend");
18
- onnxruntime_common_1.registerBackend('cpu', backend_1.onnxruntimeBackend, 1);
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation. All rights reserved.
3
+ // Licensed under the MIT License.
4
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
+ if (k2 === undefined) k2 = k;
6
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
7
+ }) : (function(o, m, k, k2) {
8
+ if (k2 === undefined) k2 = k;
9
+ o[k2] = m[k];
10
+ }));
11
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
12
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ __exportStar(require("onnxruntime-common"), exports);
16
+ const onnxruntime_common_1 = require("onnxruntime-common");
17
+ const backend_1 = require("./backend");
18
+ onnxruntime_common_1.registerBackend('cpu', backend_1.onnxruntimeBackend, 1);
19
19
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -13,9 +13,9 @@
13
13
  3
14
14
  ]
15
15
  },
16
- "version": "1.11.0-dev.20220217-8d06e5a9d",
16
+ "version": "1.11.0-dev.20220318-b713855a9",
17
17
  "dependencies": {
18
- "onnxruntime-common": "~1.11.0-dev.20220124-3dfadf903"
18
+ "onnxruntime-common": "~1.11.0-dev.20220318-b713855a9"
19
19
  },
20
20
  "scripts": {
21
21
  "buildr": "tsc && node ./script/build --config=RelWithDebInfo",
@@ -34,18 +34,18 @@
34
34
  "ONNX Runtime"
35
35
  ],
36
36
  "devDependencies": {
37
- "fs-extra": "^9.1.0",
37
+ "@types/fs-extra": "^9.0.6",
38
+ "@types/minimist": "1.2.1",
39
+ "@types/mocha": "^8.2.2",
40
+ "@types/node": "^14.14.37",
38
41
  "cmake-js": "^6.2.1",
42
+ "fs-extra": "^9.1.0",
39
43
  "jsonc": "^2.0.0",
40
- "onnx-proto": "^4.0.4",
41
44
  "minimist": "^1.2.5",
42
- "mocha": "^8.2.1",
43
- "@types/mocha": "^8.2.2",
44
- "typescript": "^4.2.4",
45
- "@types/fs-extra": "^9.0.6",
45
+ "mocha": "^9.2.1",
46
46
  "node-addon-api": "^3.1.0",
47
- "@types/node": "^14.14.37",
48
- "@types/minimist": "1.2.1"
47
+ "onnx-proto": "^4.0.4",
48
+ "typescript": "^4.2.4"
49
49
  },
50
50
  "main": "dist/index.js",
51
51
  "os": [