mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-16 21:00:14 +00:00
### Description
Add an API for users to get version of current package. example usage:
```js
import { env } from 'onnxruntime-node';
console.log(env.versions.node); // output "1.16.0"
```
```js
import { env } from 'onnxruntime-web';
console.log(env.versions.web); // output "1.16.0"
console.log(env.versions.common); // output "1.16.0"
console.log(env.versions.node); // output "undefined"
```
#16156
11 lines
360 B
TypeScript
11 lines
360 B
TypeScript
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
// Licensed under the MIT License.
|
|
|
|
export * from 'onnxruntime-common';
|
|
import {registerBackend, env} from 'onnxruntime-common';
|
|
import {onnxruntimeBackend} from './backend';
|
|
import {version} from './version';
|
|
|
|
registerBackend('cpu', onnxruntimeBackend, 1);
|
|
|
|
env.versions['react-native'] = version;
|