[js] enable formatter for more file types (#16888)

### Description
enable formatter for .js/.json/.jsonc/.md files
This commit is contained in:
Yulong Wang 2023-07-28 15:46:58 -07:00 committed by GitHub
parent 65534ff9ef
commit 1743e9a615
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
64 changed files with 39600 additions and 103263 deletions

23
js/.prettierignore Normal file
View file

@ -0,0 +1,23 @@
# ignore generated docs
web/docs/
# this JSON file is too large, so it takes too long to format it.
node/test/testdata/squeezenet.input0.json
# ignore dist folder
dist/
# ignore file types that handled by clang-format
**/*.cc
**/*.cpp
**/*.h
**/*.js
**/*.mjs
**/*.cjs
**/*.jsx
**/*.ts
**/*.mts
**/*.cts
**/*.tsx
**/*.java
**/*.mm

1
js/.prettierrc Normal file
View file

@ -0,0 +1 @@
{ "printWidth": 120, "endOfLine": "auto", "singleQuote": false }

View file

@ -3,6 +3,10 @@
"editor.formatOnSave": true,
"editor.defaultFormatter": "xaver.clang-format"
},
"[json]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[jsonc]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
@ -11,6 +15,10 @@
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "xaver.clang-format"
},
"[typescript]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "xaver.clang-format"
@ -37,5 +45,6 @@
"./types": true
},
"typescript.tsdk": "node_modules/typescript/lib",
"git.detectSubmodules": false
"git.detectSubmodules": false,
"cmake.configureOnOpen": false
}

View file

@ -249,13 +249,13 @@ By default, the WebAssembly artifacts from onnxruntime-web package allows use of
By default, the main bundle file `ort.min.js` of ONNX Runtime Web contains all features. However, its size is over 500kB and for some scenarios we want a smaller sized bundle file, if we don't use all the features. The following table lists all available bundles with their support status of features.
|bundle file name|file size|file size (gzipped)|WebGL|WASM-core|WASM-proxy|WASM-threads|ES5 backward compatibility|
|-|-|-|-|------|-----|---|-|
|ort.es5.min.js|594.15KB|134.25KB|O|O|O|O|O|
|ort.min.js|526.02KB|125.07KB|O|O|O|O|X|
|ort.webgl.min.js|385.25KB|83.83KB|O|X|X|X|X|
|ort.wasm.min.js|148.56|44KB|X|O|O|O|X|
|ort.wasm-core.min.js|40.56KB|12.74KB|X|O|X|X|X|
| bundle file name | file size | file size (gzipped) | WebGL | WASM-core | WASM-proxy | WASM-threads | ES5 backward compatibility |
| -------------------- | --------- | ------------------- | ----- | --------- | ---------- | ------------ | -------------------------- |
| ort.es5.min.js | 594.15KB | 134.25KB | O | O | O | O | O |
| ort.min.js | 526.02KB | 125.07KB | O | O | O | O | X |
| ort.webgl.min.js | 385.25KB | 83.83KB | O | X | X | X | X |
| ort.wasm.min.js | 148.56 | 44KB | X | O | O | O | X |
| ort.wasm-core.min.js | 40.56KB | 12.74KB | X | O | X | X | X |
#### Build ONNX Runtime as a WebAssembly static library
@ -304,19 +304,20 @@ From ORT v1.13 onwards the 'full' ONNX Runtime package is used. It supports both
3. In `<ORT_ROOT>`, run the below python script to build the ONNX Runtime Android archive file. On a Windows machine, this requires an admin account to build.
You can build a 'full' package that supports all operators and types, or a reduced size 'mobile' package that supports a limited set of operators and types based on your model/s to miminize the binary size.
You can build a 'full' package that supports all operators and types, or a reduced size 'mobile' package that supports a limited set of operators and types based on your model/s to miminize the binary size.
See [here](https://onnxruntime.ai/docs/build/custom.html) for information about how the reduced build works, including creating the configuration file using your model/s.
Full build:
Full build:
```sh
python tools/ci_build/github/android/build_aar_package.py tools/ci_build/github/android/default_full_aar_build_settings.json --config Release --android_sdk_path <ANDROID_SDK_PATH> --android_ndk_path <ANDROID_NDK_PATH> --build_dir <BUILD_DIRECTORY>
```
```sh
python tools/ci_build/github/android/build_aar_package.py tools/ci_build/github/android/default_full_aar_build_settings.json --config Release --android_sdk_path <ANDROID_SDK_PATH> --android_ndk_path <ANDROID_NDK_PATH> --build_dir <BUILD_DIRECTORY>
```
Reduced size build with configuration file generated from your model/s. Note that either Release or MinSizeRel could be used as the config, depending on your priorities:
```sh
python tools/ci_build/github/android/build_aar_package.py tools/ci_build/github/android/default_mobile_aar_build_settings.json --config MinSizeRel --android_sdk_path <ANDROID_SDK_PATH> --android_ndk_path <ANDROID_NDK_PATH> --build_dir <BUILD_DIRECTORY> --include_ops_by_config <required_ops_and_types_for_your_models.config> --enable_reduced_operator_type_support
```
Reduced size build with configuration file generated from your model/s. Note that either Release or MinSizeRel could be used as the config, depending on your priorities:
```sh
python tools/ci_build/github/android/build_aar_package.py tools/ci_build/github/android/default_mobile_aar_build_settings.json --config MinSizeRel --android_sdk_path <ANDROID_SDK_PATH> --android_ndk_path <ANDROID_NDK_PATH> --build_dir <BUILD_DIRECTORY> --include_ops_by_config <required_ops_and_types_for_your_models.config> --enable_reduced_operator_type_support
```
4. Move the generated ONNX Runtime Android archive file to `<ORT_ROOT>/js/react_native/android/libs/`.
@ -326,7 +327,6 @@ From ORT v1.13 onwards the 'full' ONNX Runtime package is used. It supports both
Reduced size build:
Copy `<BUILD_DIRECTORY>/aar_out/MinSizeRel/com/microsoft/onnxruntime/onnxruntime-mobile/<version>/onnxruntime-mobile-<version>.aar` into `<ORT_ROOT>/js/react_native/android/libs` directory and update to dependencies in [js/react_native/android/build.gradle](https://github.com/microsoft/onnxruntime/blob/365a01397dbd1293e0c2773380c57fd271432b72/js/react_native/android/build.gradle#L136-L137) to use onnxruntime-mobile instead of onnxruntime-android.
5. To verify, open the Android Emulator and run this command from `<ORT_ROOT>/js/react_native/android`
```sh
@ -342,23 +342,27 @@ From ORT v1.13 onwards the 'full' ONNX Runtime package is used. It supports both
3. Build a fat ONNX Runtime Mobile Framework for iOS and iOS simulator from `<ORT_ROOT>` using this command:
Full build:
```sh
python tools/ci_build/github/apple/build_ios_framework.py tools/ci_build/github/apple/default_full_ios_framework_build_settings.json --config Release
```
Reduced size build:
```sh
python tools/ci_build/github/apple/build_ios_framework.py tools/ci_build/github/apple/default_mobile_ios_framework_build_settings.json --config MinSizeRel --include_ops_by_config <required_ops_and_types_for_your_models.config> --enable_reduced_operator_type_support
```
The build creates `Headers`, `LICENSE`, and `onnxruntime.xcframework` in `build/iOS_framework/framework_out` directory. From `framework_out` directory, create an archive file named `onnxruntime-c.zip` for a full build or `onnxruntime-mobile-c.zip` for a reduced size build and copy to `<ORT_ROOT>/js/react_native/local_pods` directory.
The build creates `Headers`, `LICENSE`, and `onnxruntime.xcframework` in `build/iOS_framework/framework_out` directory. From `framework_out` directory, create an archive file named `onnxruntime-c.zip` for a full build or `onnxruntime-mobile-c.zip` for a reduced size build and copy to `<ORT_ROOT>/js/react_native/local_pods` directory.
Full build:
```sh
zip -r onnxruntime-c.zip .
```
Reduced size build:
```sh
zip -r onnxruntime-mobile-c.zip .
```
@ -366,9 +370,10 @@ From ORT v1.13 onwards the 'full' ONNX Runtime package is used. It supports both
4. To verify, open the iOS Simulator and run the below command from `<ORT_ROOT>/js/react_native/ios`. Change the destination argument as needed to specify a running iOS Simulator.
If using the reduced size build it is necessary to first update some configuration to use the mobile ORT package:
- replace `onnxruntime/onnxruntime.framework` with `onnxruntime-mobile/onnxruntime.framework` in /js/react_native/ios/OnnxruntimeModule.xcodeproj/project.pbxproj
- replace `onnxruntime-c` with `onnxruntime-mobile-c` in /js/react_native/ios/Podfile
- For reference, [this PR](https://github.com/microsoft/onnxruntime/pull/13037) shows the changes made to switch from using the 'mobile' ORT package to the 'full' package.
- replace `onnxruntime/onnxruntime.framework` with `onnxruntime-mobile/onnxruntime.framework` in /js/react_native/ios/OnnxruntimeModule.xcodeproj/project.pbxproj
- replace `onnxruntime-c` with `onnxruntime-mobile-c` in /js/react_native/ios/Podfile
- For reference, [this PR](https://github.com/microsoft/onnxruntime/pull/13037) shows the changes made to switch from using the 'mobile' ORT package to the 'full' package.
```sh
pod install
@ -394,74 +399,82 @@ From ORT v1.13 onwards the 'full' ONNX Runtime package is used. It supports both
When testing with a custom built ONNX Runtime iOS package, copy `onnxruntime-[mobile-]c.zip` into the `<ORT_ROOT>/js/react_native/local_pods` directory.
If using the reduced size build it is necessary to update some configuration to use the mobile ORT package:
- replace `com.microsoft.onnxruntime:onnxruntime-android` with `com.microsoft.onnxruntime:onnxruntime-mobile` in /js/react_native/e2e/android/app/build.gradle
- replace `onnxruntime-c` with `onnxruntime-mobile-c` in /js/react_native/e2e/ios/Podfile
- Run E2E Testing with Detox framework
- replace `com.microsoft.onnxruntime:onnxruntime-android` with `com.microsoft.onnxruntime:onnxruntime-mobile` in /js/react_native/e2e/android/app/build.gradle
- replace `onnxruntime-c` with `onnxruntime-mobile-c` in /js/react_native/e2e/ios/Podfile
When testing with integrated [Detox](https://wix.github.io/Detox/docs/next/introduction/getting-started) framework for Android and iOS e2e apps:
- Detox prerequisites:
- Run E2E Testing with Detox framework
Install detox command line tools:
```
yarn global add detox-cli
```
Install applesimutils which is required by Detox to work with iOS simulators. (Requires a MacOS device)
```
brew tap wix/brew
brew install applesimutils
```
Main Detox project files:
- `.detoxrc.js` -Detox config file;
- `e2e/jest.config.js` -Jest configuration;
- `e2e/OnnxruntimeModuleExample.test.js` - initial react native onnxruntimemodule e2e detox test.
- Build the detox e2e testing app.
When testing with integrated [Detox](https://wix.github.io/Detox/docs/next/introduction/getting-started) framework for Android and iOS e2e apps:
From `<ORT_ROOT>/js/react_native/e2e`, run the command to build the e2e testing app. Before that ensure you have android emulator/ios simulator started locally.
- Detox prerequisites:
iOS (Debug):
Install detox command line tools:
```
detox build --configuration ios.sim.debug
```
Android (Debug):
```
yarn global add detox-cli
```
```
detox build --configuration android.emu.debug
```
* Note: If names of local testing android/ios devices do not match the default setting in `.detoxrc.js` file,
Install applesimutils which is required by Detox to work with iOS simulators. (Requires a MacOS device)
```
brew tap wix/brew
brew install applesimutils
```
Main Detox project files:
- `.detoxrc.js` -Detox config file;
- `e2e/jest.config.js` -Jest configuration;
- `e2e/OnnxruntimeModuleExample.test.js` - initial react native onnxruntimemodule e2e detox test.
- Build the detox e2e testing app.
From `<ORT_ROOT>/js/react_native/e2e`, run the command to build the e2e testing app. Before that ensure you have android emulator/ios simulator started locally.
iOS (Debug):
```
detox build --configuration ios.sim.debug
```
Android (Debug):
```
detox build --configuration android.emu.debug
```
- Note: If names of local testing android/ios devices do not match the default setting in `.detoxrc.js` file,
modify the device name in config files accordingly to match local device name otherwise would cause a build failure.
- Run the detox e2e tests.
In a debug configuration, you need to have React Native packager running in parallel before you start Detox tests:
- Run the detox e2e tests.
```
npm start
In a debug configuration, you need to have React Native packager running in parallel before you start Detox tests:
> react-native start
```
From `<ORT_ROOT>/js/react_native/e2e`, run Detox tests using the following command:
```
npm start
iOS (Debug):
> react-native start
```
```
detox test --configuration ios.sim.debug
```
From `<ORT_ROOT>/js/react_native/e2e`, run Detox tests using the following command:
Android (Debug):
iOS (Debug):
```
detox test --configuration android.emu.debug
```
```
detox test --configuration ios.sim.debug
```
To record logs for testing results, add `--record-logs`. Output logs and test results will be produced in the `e2e/artifacts/` folder.
See: [Detox/logger#artifacts](https://wix.github.io/Detox/docs/api/logger#artifacts)
***`yarn bootstrap` changes `packages.json` and `yarn.lock` files. Once testing is done, restore changes to avoid unwanted commit.***
Android (Debug):
```
detox test --configuration android.emu.debug
```
To record logs for testing results, add `--record-logs`. Output logs and test results will be produced in the `e2e/artifacts/` folder.
See: [Detox/logger#artifacts](https://wix.github.io/Detox/docs/api/logger#artifacts)
**_`yarn bootstrap` changes `packages.json` and `yarn.lock` files. Once testing is done, restore changes to avoid unwanted commit._**
5. Run Android and iOS apps.
@ -469,6 +482,7 @@ From ORT v1.13 onwards the 'full' ONNX Runtime package is used. It supports both
yarn e2e android
yarn e2e ios
```
### NPM Packaging
1. Update a version using `npm version <version>` from `<ORT_ROOT>/js/react_native` folder. If it's for a dev, use `npm version <version>-dev.<subversion>`

View file

@ -21,8 +21,8 @@
},
"main": "dist/cjs/index.js",
"exports": {
"require": "./dist/cjs/index.js",
"import": "./dist/esm/index.js"
"require": "./dist/cjs/index.js",
"import": "./dist/esm/index.js"
},
"keywords": [
"ONNX",

View file

@ -5,7 +5,7 @@
"declaration": true,
"declarationMap": true,
"esModuleInterop": false,
"noUnusedParameters": true,
"noUnusedParameters": true
},
"include": ["lib"]
}

View file

@ -1,7 +1,5 @@
{
"entryPoints": [
"lib/index.ts"
],
"entryPoints": ["lib/index.ts"],
"excludeInternal": true,
"name": "ONNX Runtime JavaScript API",
"readme": "none",

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

22
js/package-lock.json generated
View file

@ -25,6 +25,7 @@
"mocha": "^10.2.0",
"node-polyfill-webpack-plugin": "^2.0.1",
"npmlog": "^7.0.1",
"prettier": "^3.0.0",
"terser": "^5.16.5",
"ts-loader": "^9.4.2",
"typescript": "^4.9.5",
@ -4616,6 +4617,21 @@
"node": ">= 0.8.0"
}
},
"node_modules/prettier": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.0.tgz",
"integrity": "sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g==",
"dev": true,
"bin": {
"prettier": "bin/prettier.cjs"
},
"engines": {
"node": ">=14"
},
"funding": {
"url": "https://github.com/prettier/prettier?sponsor=1"
}
},
"node_modules/process": {
"version": "0.11.10",
"resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz",
@ -9608,6 +9624,12 @@
"integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==",
"dev": true
},
"prettier": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.0.tgz",
"integrity": "sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g==",
"dev": true
},
"process": {
"version": "0.11.10",
"resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz",

View file

@ -19,6 +19,7 @@
"mocha": "^10.2.0",
"node-polyfill-webpack-plugin": "^2.0.1",
"npmlog": "^7.0.1",
"prettier": "^3.0.0",
"terser": "^5.16.5",
"ts-loader": "^9.4.2",
"typescript": "^4.9.5",
@ -30,7 +31,12 @@
"scripts": {
"prepare": "tsc --build scripts",
"lint": "eslint . --ext .ts --ext .tsx",
"format": "clang-format --glob=\"{scripts/**/*.ts,common/lib/**/*.ts,node/{lib,script,test}/**/*.ts,node/src/**/*.{cc,h},web/{lib,script,test}/**/*.ts,react_native/{android,example,ios,lib}/**/*.{ts,mm,java}}\" --style=file -i",
"format:ts": "clang-format --glob=\"{scripts/**/*.ts,common/{lib,test}/**/*.ts,node/{lib,script,test}/**/*.ts,web/{lib,script,test}/**/*.ts,react_native/{android,example,ios,lib}/**/*.{ts,tsx}}\" --style=file -i",
"format:js": "clang-format --glob=\"{{,common,node,web,react_native}/{*,.*}.{,m,c}js,web/test/e2e/**/*.{,m,c}js}\" --style=file -i",
"format:cf": "clang-format --glob=\"{node/src/**/*.{cc,h},react_native/{android,example,ios,lib}/**/*.{mm,java}}\" --style=file -i",
"format:json": "prettier \"**/*.{json,jsonc}\" --write",
"format:md": "prettier \"**/*.md\" --write",
"format": "npm run format:ts && npm run format:js && npm run format:cf && npm run format:json && npm run format:md",
"prepare-node-tests": "node ./scripts/prepare-onnx-node-tests",
"update-version": "node ./scripts/update-version"
},

View file

@ -28,6 +28,7 @@ const result = session.run(input, ['num_detection:0', 'detection_classes:0'])
```
Refer to [ONNX Runtime JavaScript examples](https://github.com/microsoft/onnxruntime-inference-examples/tree/main/js) for samples and tutorials. The ONNX Runtime React Native library does not currently support the following features:
- Tensors with unsigned data types, with the exception of uint8 on Android devices
- Model loading using ArrayBuffer

View file

@ -1,5 +1,5 @@
'use strict';
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
presets : ['module:metro-react-native-babel-preset'],
};

View file

@ -1,38 +1,38 @@
{
"images" : [
"images": [
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "2x"
"idiom": "iphone",
"size": "29x29",
"scale": "2x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "3x"
"idiom": "iphone",
"size": "29x29",
"scale": "3x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
"idiom": "iphone",
"size": "40x40",
"scale": "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "3x"
"idiom": "iphone",
"size": "40x40",
"scale": "3x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
"idiom": "iphone",
"size": "60x60",
"scale": "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
"idiom": "iphone",
"size": "60x60",
"scale": "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
"info": {
"version": 1,
"author": "xcode"
}
}
}

View file

@ -1,6 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
"info": {
"version": 1,
"author": "xcode"
}
}

View file

@ -1,4 +1,4 @@
{
"name": "onnxruntime-react-native",
"platforms": ["ios", "android"]
"name": "onnxruntime-react-native",
"platforms": ["ios", "android"]
}

View file

@ -53,6 +53,7 @@ ONNX Runtime Web currently support all operators in [ai.onnx](https://github.com
ONNX Runtime Web currently supports a subset of operators in [ai.onnx](https://github.com/onnx/onnx/blob/main/docs/Operators.md) operator set. See [webgl-operators.md](./docs/webgl-operators.md) for a complete, detailed list of which ONNX operators are supported by WebGL backend.
#### WebGPU backend
WebGPU backend is still an experimental feature. See [webgpu-operators.md](./docs/webgpu-operators.md) for a detailed list of which ONNX operators are supported by WebGPU backend.
## License

View file

@ -43,7 +43,7 @@ const hostname = getMachineIpAddress();
// In Node.js v17+, 'localhost' is using IPv6, so need to listen to '::'
const listenAddress = Number.parseInt(process.versions.node.split('.')[0]) >= 17 ? '::' : '0.0.0.0';
module.exports = function (config) {
module.exports = function(config) {
config.set({
// global config of your BrowserStack account
browserStack: {
@ -55,17 +55,17 @@ module.exports = function (config) {
},
frameworks: ['mocha'],
files: [
{ pattern: commonFile },
{ pattern: mainFile },
{ pattern: 'test/testdata-file-cache-*.json', included: false },
{ pattern: 'test/data/**/*', included: false, nocache: true },
{ pattern: 'dist/ort-wasm.wasm', included: false },
{ pattern: 'dist/ort-wasm-threaded.wasm', included: false },
{ pattern: 'dist/ort-wasm-simd.wasm', included: false },
{ pattern: 'dist/ort-wasm-simd-threaded.wasm', included: false },
{ pattern: 'dist/ort-wasm-simd.jsep.wasm', included: false },
{ pattern: 'dist/ort-wasm-simd-threaded.jsep.wasm', included: false },
{ pattern: 'dist/ort-wasm-threaded.worker.js', included: false },
{pattern: commonFile},
{pattern: mainFile},
{pattern: 'test/testdata-file-cache-*.json', included: false},
{pattern: 'test/data/**/*', included: false, nocache: true},
{pattern: 'dist/ort-wasm.wasm', included: false},
{pattern: 'dist/ort-wasm-threaded.wasm', included: false},
{pattern: 'dist/ort-wasm-simd.wasm', included: false},
{pattern: 'dist/ort-wasm-simd-threaded.wasm', included: false},
{pattern: 'dist/ort-wasm-simd.jsep.wasm', included: false},
{pattern: 'dist/ort-wasm-simd-threaded.jsep.wasm', included: false},
{pattern: 'dist/ort-wasm-threaded.worker.js', included: false},
],
proxies: {
'/base/test/ort-wasm.wasm': '/base/dist/ort-wasm.wasm',
@ -77,8 +77,8 @@ module.exports = function (config) {
'/base/test/ort-wasm-threaded.worker.js': '/base/dist/ort-wasm-threaded.worker.js',
},
plugins: karmaPlugins,
client: { captureConsole: true, mocha: { expose: ['body'], timeout: timeoutMocha } },
preprocessors: { mainFile: ['sourcemap'] },
client: {captureConsole: true, mocha: {expose: ['body'], timeout: timeoutMocha}},
preprocessors: {mainFile: ['sourcemap']},
reporters: ['mocha', 'BrowserStack'],
browsers: [],
captureTimeout: 120000,
@ -90,41 +90,26 @@ module.exports = function (config) {
hostname,
listenAddress,
customLaunchers: {
ChromeTest: {
base: 'Chrome',
flags: ['--enable-features=SharedArrayBuffer']
},
ChromeTestHeadless: {
base: 'ChromeHeadless',
flags: ['--enable-features=SharedArrayBuffer']
},
ChromeDebug: {
debug: true,
base: 'Chrome', flags: ['--remote-debugging-port=9333', '--enable-features=SharedArrayBuffer']
},
ChromeTest: {base: 'Chrome', flags: ['--enable-features=SharedArrayBuffer']},
ChromeTestHeadless: {base: 'ChromeHeadless', flags: ['--enable-features=SharedArrayBuffer']},
ChromeDebug:
{debug: true, base: 'Chrome', flags: ['--remote-debugging-port=9333', '--enable-features=SharedArrayBuffer']},
ChromeCanaryTest: {
base: 'ChromeCanary',
flags: [
'--enable-features=SharedArrayBuffer',
'--enable-experimental-web-platform-features'
]
flags: ['--enable-features=SharedArrayBuffer', '--enable-experimental-web-platform-features']
},
ChromeCanaryDebug: {
debug: true,
base: 'ChromeCanary',
flags: [
'--remote-debugging-port=9333',
'--enable-features=SharedArrayBuffer',
'--remote-debugging-port=9333', '--enable-features=SharedArrayBuffer',
'--enable-experimental-web-platform-features'
]
},
ChromeWebGpuProfileTest: {
base: 'Chrome',
flags: [
'--window-size=1,1',
'--enable-features=SharedArrayBuffer',
'--disable-dawn-features=disallow_unsafe_apis'
]
flags:
['--window-size=1,1', '--enable-features=SharedArrayBuffer', '--disable-dawn-features=disallow_unsafe_apis']
},
ChromeWebGpuProfileDebug: {
debug: true,
@ -141,85 +126,33 @@ module.exports = function (config) {
// Windows
//
BS_WIN_10_Chrome_91: {
base: 'BrowserStack',
os: 'Windows',
os_version: '10',
browser: 'Chrome',
browser_version: '91'
},
BS_WIN_10_Edge_91: {
base: 'BrowserStack',
os: 'Windows',
os_version: '10',
browser: 'Edge',
browser_version: '91'
},
BS_WIN_10_Firefox_89: {
base: 'BrowserStack',
os: 'Windows',
os_version: '10',
browser: 'Firefox',
browser_version: '89'
},
BS_WIN_10_Chrome_91:
{base: 'BrowserStack', os: 'Windows', os_version: '10', browser: 'Chrome', browser_version: '91'},
BS_WIN_10_Edge_91:
{base: 'BrowserStack', os: 'Windows', os_version: '10', browser: 'Edge', browser_version: '91'},
BS_WIN_10_Firefox_89:
{base: 'BrowserStack', os: 'Windows', os_version: '10', browser: 'Firefox', browser_version: '89'},
// macOS
//
BS_MAC_11_Safari_14: {
base: 'BrowserStack',
os: 'OS X',
os_version: 'Big Sur',
browser: 'Safari',
browser_version: '14.0'
},
BS_MAC_11_Chrome_91: {
base: 'BrowserStack',
os: 'OS X',
os_version: 'Big Sur',
browser: 'Chrome',
browser_version: '91'
},
BS_MAC_11_Safari_14:
{base: 'BrowserStack', os: 'OS X', os_version: 'Big Sur', browser: 'Safari', browser_version: '14.0'},
BS_MAC_11_Chrome_91:
{base: 'BrowserStack', os: 'OS X', os_version: 'Big Sur', browser: 'Chrome', browser_version: '91'},
// iPhone
//
BS_IOS_14_iPhoneXS: {
base: 'BrowserStack',
device: 'iPhone XS',
real_mobile: true,
os: 'ios',
os_version: '14'
},
BS_IOS_13_iPhoneXS: {
base: 'BrowserStack',
device: 'iPhone XS',
real_mobile: true,
os: 'ios',
os_version: '13'
},
BS_IOS_14_iPhoneXS: {base: 'BrowserStack', device: 'iPhone XS', real_mobile: true, os: 'ios', os_version: '14'},
BS_IOS_13_iPhoneXS: {base: 'BrowserStack', device: 'iPhone XS', real_mobile: true, os: 'ios', os_version: '13'},
// Android
//
BS_ANDROID_11_Pixel_5: {
base: 'BrowserStack',
device: 'Google Pixel 5',
real_mobile: true,
os: 'android',
os_version: '11.0'
},
BS_ANDROID_11_Galaxy_S_21: {
base: 'BrowserStack',
device: 'Samsung Galaxy S21',
real_mobile: true,
os: 'android',
os_version: '11.0'
},
BS_ANDROID_10_Pixel_4: {
base: 'BrowserStack',
device: 'Google Pixel 4',
real_mobile: true,
os: 'android',
os_version: '10.0'
}
BS_ANDROID_11_Pixel_5:
{base: 'BrowserStack', device: 'Google Pixel 5', real_mobile: true, os: 'android', os_version: '11.0'},
BS_ANDROID_11_Galaxy_S_21:
{base: 'BrowserStack', device: 'Samsung Galaxy S21', real_mobile: true, os: 'android', os_version: '11.0'},
BS_ANDROID_10_Pixel_4:
{base: 'BrowserStack', device: 'Google Pixel 4', real_mobile: true, os: 'android', os_version: '10.0'}
}
});
};

View file

@ -1,4 +1,5 @@
# ORT Format File
This directory contains [the generated ts file](ort-generated.ts) necessary to support the ORT file format. The file is generated from [the ORT file format schema](https://github.com/microsoft/onnxruntime/blob/d42399e1b07ce61e95aae88bc6b6ea5dcaae2011/onnxruntime/core/flatbuffers/schema/ort.fbs). Please do not directly modify [the generated ts header file](ort-generated.ts).
[The ORT file format schema](https://github.com/microsoft/onnxruntime/blob/d42399e1b07ce61e95aae88bc6b6ea5dcaae2011/onnxruntime/core/flatbuffers/schema/ort.fbs) uses [FlatBuffers](https://github.com/google/flatbuffers) serialization library. To update [its generated ts file](ort-generated.ts),

View file

@ -1,12 +1,14 @@
# ONNX protobuf
This directory contains generated protobuf definition for onnx:
- onnx.js
- onnx.d.ts
- onnx.js
- onnx.d.ts
These files are generated from [a fork of onnx-proto](https://github.com/fs-eire/onnx-proto/tree/update-v9).
The ONNX protobuf uses protobufjs@7.2.4, which depends on long@5.2.3, the version contains 2 bugs:
- type export does not work with commonjs. described in https://github.com/dcodeIO/long.js/pull/124. added a "postinstall" script to fix.
- in the generated typescript declaration file 'onnx.d.ts', the following line:
```ts
@ -14,6 +16,6 @@ The ONNX protobuf uses protobufjs@7.2.4, which depends on long@5.2.3, the versio
```
need to be replaced to fix type import error:
```ts
import Long from 'long';
import Long from "long";
```
this replacement is done and code format is also applied to file 'onnx.d.ts'.

View file

@ -8,64 +8,14 @@
"name": "T[2,3,4]",
"inputs": [
{
"data": [
1,
2,
3,
4,
5,
6,
7,
8,
11,
12,
13,
14,
-1,
-2,
-3,
-4,
-5,
-6,
-7,
-8,
101,
102,
103,
104
],
"data": [1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 13, 14, -1, -2, -3, -4, -5, -6, -7, -8, 101, 102, 103, 104],
"dims": [2, 3, 4],
"type": "float32"
}
],
"outputs": [
{
"data": [
1,
2,
3,
4,
5,
6,
7,
8,
11,
12,
13,
14,
1,
2,
3,
4,
5,
6,
7,
8,
101,
102,
103,
104
],
"data": [1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 13, 14, 1, 2, 3, 4, 5, 6, 7, 8, 101, 102, 103, 104],
"dims": [2, 3, 4],
"type": "float32"
}

View file

@ -49,16 +49,7 @@
],
"outputs": [
{
"data": [
1.4706,
1.3694,
1.2661,
1.1593,
0.451,
0.6435,
0.7954,
0.9273
],
"data": [1.4706, 1.3694, 1.2661, 1.1593, 0.451, 0.6435, 0.7954, 0.9273],
"dims": [2, 4],
"type": "float32"
}

View file

@ -79,64 +79,14 @@
"type": "float32"
},
{
"data": [
2,
6,
1,
2,
1,
3,
1,
4,
3,
5,
3,
4,
1,
4,
1,
6,
4,
4,
5,
6,
2,
4,
2,
6
],
"data": [2, 6, 1, 2, 1, 3, 1, 4, 3, 5, 3, 4, 1, 4, 1, 6, 4, 4, 5, 6, 2, 4, 2, 6],
"dims": [3, 2, 4],
"type": "float32"
}
],
"outputs": [
{
"data": [
3,
8,
4,
6,
6,
9,
8,
12,
4,
7,
6,
8,
6,
10,
8,
14,
5,
6,
8,
10,
7,
10,
9,
14
],
"data": [3, 8, 4, 6, 6, 9, 8, 12, 4, 7, 6, 8, 6, 10, 8, 14, 5, 6, 8, 10, 7, 10, 9, 14],
"dims": [3, 2, 4],
"type": "float32"
}

View file

@ -49,16 +49,7 @@
],
"outputs": [
{
"data": [
0.10016742,
0.20135792,
0.30469265,
0.41151685,
1.11976951,
0.92729522,
0.7753975,
0.64350111
],
"data": [0.10016742, 0.20135792, 0.30469265, 0.41151685, 1.11976951, 0.92729522, 0.7753975, 0.64350111],
"dims": [2, 4],
"type": "float32"
}

View file

@ -21,8 +21,8 @@
"outputs": [
{
"data": [
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 1, 2, 3, 4,
5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16
],
"dims": [8, 4],
"type": "float32"
@ -97,8 +97,8 @@
"outputs": [
{
"data": [
1, 2, 3, 4, 1, 2, 3, 4, 5, 6, 7, 8, 5, 6, 7, 8, 9, 10, 11, 12, 9,
10, 11, 12, 13, 14, 15, 16, 13, 14, 15, 16
1, 2, 3, 4, 1, 2, 3, 4, 5, 6, 7, 8, 5, 6, 7, 8, 9, 10, 11, 12, 9, 10, 11, 12, 13, 14, 15, 16, 13, 14, 15,
16
],
"dims": [4, 8],
"type": "float32"
@ -173,8 +173,8 @@
"outputs": [
{
"data": [
1, 2, 5, 6, 3, 4, 7, 8, 9, 10, 13, 14, 11, 12, 15, 16, 1, 2, 5, 6,
3, 4, 7, 8, 9, 10, 13, 14, 11, 12, 15, 16
1, 2, 5, 6, 3, 4, 7, 8, 9, 10, 13, 14, 11, 12, 15, 16, 1, 2, 5, 6, 3, 4, 7, 8, 9, 10, 13, 14, 11, 12, 15,
16
],
"dims": [4, 2, 4],
"type": "float32"
@ -205,8 +205,8 @@
"outputs": [
{
"data": [
1, 2, 5, 6, 3, 4, 7, 8, 1, 2, 5, 6, 3, 4, 7, 8, 9, 10, 13, 14, 11,
12, 15, 16, 9, 10, 13, 14, 11, 12, 15, 16
1, 2, 5, 6, 3, 4, 7, 8, 1, 2, 5, 6, 3, 4, 7, 8, 9, 10, 13, 14, 11, 12, 15, 16, 9, 10, 13, 14, 11, 12, 15,
16
],
"dims": [2, 4, 4],
"type": "float32"
@ -237,8 +237,8 @@
"outputs": [
{
"data": [
1, 2, 5, 6, 1, 2, 5, 6, 3, 4, 7, 8, 3, 4, 7, 8, 9, 10, 13, 14, 9,
10, 13, 14, 11, 12, 15, 16, 11, 12, 15, 16
1, 2, 5, 6, 1, 2, 5, 6, 3, 4, 7, 8, 3, 4, 7, 8, 9, 10, 13, 14, 9, 10, 13, 14, 11, 12, 15, 16, 11, 12, 15,
16
],
"dims": [2, 2, 8],
"type": "float32"
@ -257,16 +257,16 @@
"inputs": [
{
"data": [
1, 2, 5, 6, 3, 4, 7, 8, 9, 10, 13, 14, 11, 12, 15, 16, 17, 18, 21,
22, 19, 20, 23, 24, 25, 26, 29, 30, 27, 28, 31, 32
1, 2, 5, 6, 3, 4, 7, 8, 9, 10, 13, 14, 11, 12, 15, 16, 17, 18, 21, 22, 19, 20, 23, 24, 25, 26, 29, 30, 27,
28, 31, 32
],
"dims": [2, 2, 2, 4],
"type": "float32"
},
{
"data": [
1, 2, 5, 6, 3, 4, 7, 8, 9, 10, 13, 14, 11, 12, 15, 16, 17, 18, 21,
22, 19, 20, 23, 24, 25, 26, 29, 30, 27, 28, 31, 32
1, 2, 5, 6, 3, 4, 7, 8, 9, 10, 13, 14, 11, 12, 15, 16, 17, 18, 21, 22, 19, 20, 23, 24, 25, 26, 29, 30, 27,
28, 31, 32
],
"dims": [2, 2, 2, 4],
"type": "float32"
@ -275,10 +275,9 @@
"outputs": [
{
"data": [
1, 2, 5, 6, 3, 4, 7, 8, 9, 10, 13, 14, 11, 12, 15, 16, 17, 18, 21,
22, 19, 20, 23, 24, 25, 26, 29, 30, 27, 28, 31, 32, 1, 2, 5, 6, 3,
4, 7, 8, 9, 10, 13, 14, 11, 12, 15, 16, 17, 18, 21, 22, 19, 20,
23, 24, 25, 26, 29, 30, 27, 28, 31, 32
1, 2, 5, 6, 3, 4, 7, 8, 9, 10, 13, 14, 11, 12, 15, 16, 17, 18, 21, 22, 19, 20, 23, 24, 25, 26, 29, 30, 27,
28, 31, 32, 1, 2, 5, 6, 3, 4, 7, 8, 9, 10, 13, 14, 11, 12, 15, 16, 17, 18, 21, 22, 19, 20, 23, 24, 25, 26,
29, 30, 27, 28, 31, 32
],
"dims": [4, 2, 2, 4],
"type": "float32"
@ -297,16 +296,16 @@
"inputs": [
{
"data": [
1, 2, 5, 6, 3, 4, 7, 8, 9, 10, 13, 14, 11, 12, 15, 16, 17, 18, 21,
22, 19, 20, 23, 24, 25, 26, 29, 30, 27, 28, 31, 32
1, 2, 5, 6, 3, 4, 7, 8, 9, 10, 13, 14, 11, 12, 15, 16, 17, 18, 21, 22, 19, 20, 23, 24, 25, 26, 29, 30, 27,
28, 31, 32
],
"dims": [2, 2, 2, 4],
"type": "float32"
},
{
"data": [
1, 2, 5, 6, 3, 4, 7, 8, 9, 10, 13, 14, 11, 12, 15, 16, 17, 18, 21,
22, 19, 20, 23, 24, 25, 26, 29, 30, 27, 28, 31, 32
1, 2, 5, 6, 3, 4, 7, 8, 9, 10, 13, 14, 11, 12, 15, 16, 17, 18, 21, 22, 19, 20, 23, 24, 25, 26, 29, 30, 27,
28, 31, 32
],
"dims": [2, 2, 2, 4],
"type": "float32"
@ -315,10 +314,9 @@
"outputs": [
{
"data": [
1, 2, 5, 6, 3, 4, 7, 8, 9, 10, 13, 14, 11, 12, 15, 16, 1, 2, 5, 6,
3, 4, 7, 8, 9, 10, 13, 14, 11, 12, 15, 16, 17, 18, 21, 22, 19, 20,
23, 24, 25, 26, 29, 30, 27, 28, 31, 32, 17, 18, 21, 22, 19, 20,
23, 24, 25, 26, 29, 30, 27, 28, 31, 32
1, 2, 5, 6, 3, 4, 7, 8, 9, 10, 13, 14, 11, 12, 15, 16, 1, 2, 5, 6, 3, 4, 7, 8, 9, 10, 13, 14, 11, 12, 15,
16, 17, 18, 21, 22, 19, 20, 23, 24, 25, 26, 29, 30, 27, 28, 31, 32, 17, 18, 21, 22, 19, 20, 23, 24, 25,
26, 29, 30, 27, 28, 31, 32
],
"dims": [2, 4, 2, 4],
"type": "float32"
@ -337,16 +335,16 @@
"inputs": [
{
"data": [
1, 2, 5, 6, 3, 4, 7, 8, 9, 10, 13, 14, 11, 12, 15, 16, 17, 18, 21,
22, 19, 20, 23, 24, 25, 26, 29, 30, 27, 28, 31, 32
1, 2, 5, 6, 3, 4, 7, 8, 9, 10, 13, 14, 11, 12, 15, 16, 17, 18, 21, 22, 19, 20, 23, 24, 25, 26, 29, 30, 27,
28, 31, 32
],
"dims": [2, 2, 2, 4],
"type": "float32"
},
{
"data": [
1, 2, 5, 6, 3, 4, 7, 8, 9, 10, 13, 14, 11, 12, 15, 16, 17, 18, 21,
22, 19, 20, 23, 24, 25, 26, 29, 30, 27, 28, 31, 32
1, 2, 5, 6, 3, 4, 7, 8, 9, 10, 13, 14, 11, 12, 15, 16, 17, 18, 21, 22, 19, 20, 23, 24, 25, 26, 29, 30, 27,
28, 31, 32
],
"dims": [2, 2, 2, 4],
"type": "float32"
@ -355,10 +353,9 @@
"outputs": [
{
"data": [
1, 2, 5, 6, 3, 4, 7, 8, 1, 2, 5, 6, 3, 4, 7, 8, 9, 10, 13, 14, 11,
12, 15, 16, 9, 10, 13, 14, 11, 12, 15, 16, 17, 18, 21, 22, 19, 20,
23, 24, 17, 18, 21, 22, 19, 20, 23, 24, 25, 26, 29, 30, 27, 28,
31, 32, 25, 26, 29, 30, 27, 28, 31, 32
1, 2, 5, 6, 3, 4, 7, 8, 1, 2, 5, 6, 3, 4, 7, 8, 9, 10, 13, 14, 11, 12, 15, 16, 9, 10, 13, 14, 11, 12, 15,
16, 17, 18, 21, 22, 19, 20, 23, 24, 17, 18, 21, 22, 19, 20, 23, 24, 25, 26, 29, 30, 27, 28, 31, 32, 25,
26, 29, 30, 27, 28, 31, 32
],
"dims": [2, 2, 4, 4],
"type": "float32"
@ -377,16 +374,16 @@
"inputs": [
{
"data": [
1, 2, 5, 6, 3, 4, 7, 8, 9, 10, 13, 14, 11, 12, 15, 16, 17, 18, 21,
22, 19, 20, 23, 24, 25, 26, 29, 30, 27, 28, 31, 32
1, 2, 5, 6, 3, 4, 7, 8, 9, 10, 13, 14, 11, 12, 15, 16, 17, 18, 21, 22, 19, 20, 23, 24, 25, 26, 29, 30, 27,
28, 31, 32
],
"dims": [2, 2, 2, 4],
"type": "float32"
},
{
"data": [
1, 2, 5, 6, 3, 4, 7, 8, 9, 10, 13, 14, 11, 12, 15, 16, 17, 18, 21,
22, 19, 20, 23, 24, 25, 26, 29, 30, 27, 28, 31, 32
1, 2, 5, 6, 3, 4, 7, 8, 9, 10, 13, 14, 11, 12, 15, 16, 17, 18, 21, 22, 19, 20, 23, 24, 25, 26, 29, 30, 27,
28, 31, 32
],
"dims": [2, 2, 2, 4],
"type": "float32"
@ -395,10 +392,9 @@
"outputs": [
{
"data": [
1, 2, 5, 6, 1, 2, 5, 6, 3, 4, 7, 8, 3, 4, 7, 8, 9, 10, 13, 14, 9,
10, 13, 14, 11, 12, 15, 16, 11, 12, 15, 16, 17, 18, 21, 22, 17,
18, 21, 22, 19, 20, 23, 24, 19, 20, 23, 24, 25, 26, 29, 30, 25,
26, 29, 30, 27, 28, 31, 32, 27, 28, 31, 32
1, 2, 5, 6, 1, 2, 5, 6, 3, 4, 7, 8, 3, 4, 7, 8, 9, 10, 13, 14, 9, 10, 13, 14, 11, 12, 15, 16, 11, 12, 15,
16, 17, 18, 21, 22, 17, 18, 21, 22, 19, 20, 23, 24, 19, 20, 23, 24, 25, 26, 29, 30, 25, 26, 29, 30, 27,
28, 31, 32, 27, 28, 31, 32
],
"dims": [2, 2, 2, 8],
"type": "float32"

View file

@ -71,40 +71,7 @@
"type": "float32"
},
{
"data": [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
],
"data": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
"dims": [4, 2, 2, 2],
"type": "float32"
},
@ -170,26 +137,7 @@
"name": "T[0]",
"inputs": [
{
"data": [
0.0,
1.0,
2.0,
3.0,
4.0,
5.0,
6.0,
7.0,
8.0,
9.0,
10.0,
11.0,
12.0,
13.0,
14.0,
15.0,
16.0,
17.0
],
"data": [0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0],
"dims": [1, 2, 3, 3],
"type": "float32"
},
@ -201,26 +149,7 @@
],
"outputs": [
{
"data": [
0.0,
1.0,
2.0,
3.0,
4.0,
5.0,
6.0,
7.0,
8.0,
18.0,
20.0,
22.0,
24.0,
26.0,
28.0,
30.0,
32.0,
34.0
],
"data": [0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 18.0, 20.0, 22.0, 24.0, 26.0, 28.0, 30.0, 32.0, 34.0],
"dims": [1, 2, 3, 3],
"type": "float32"
}
@ -241,52 +170,14 @@
"inputs": [
{
"data": [
0.0,
1.0,
2.0,
3.0,
4.0,
5.0,
6.0,
7.0,
8.0,
9.0,
10.0,
11.0,
12.0,
13.0,
14.0,
15.0,
16.0,
17.0,
18.0,
19.0,
20.0,
21.0,
22.0,
23.0,
0,
0,
0
0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0,
19.0, 20.0, 21.0, 22.0, 23.0, 0, 0, 0
],
"dims": [1, 3, 3, 3],
"type": "float32"
},
{
"data": [
1.0,
2.0,
3.0,
4.0,
5.0,
6.0,
7.0,
8.0,
9.0,
10.0,
11.0,
12.0
],
"data": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0],
"dims": [3, 1, 2, 2],
"type": "float32"
},
@ -298,20 +189,7 @@
],
"outputs": [
{
"data": [
27.1,
37.1,
57.1,
67.1,
293.2,
319.2,
371.2,
397.2,
847.3,
889.3,
409.3,
428.3
],
"data": [27.1, 37.1, 57.1, 67.1, 293.2, 319.2, 371.2, 397.2, 847.3, 889.3, 409.3, 428.3],
"dims": [1, 3, 2, 2],
"type": "float32"
}
@ -332,87 +210,21 @@
"inputs": [
{
"data": [
0.0,
1.0,
2.0,
3.0,
4.0,
5.0,
6.0,
7.0,
8.0,
9.0,
10.0,
11.0,
12.0,
13.0,
14.0,
15.0,
16.0,
17.0,
18.0,
19.0,
20.0,
21.0,
22.0,
23.0,
24.0,
25.0,
26.0,
27.0,
28.0,
29.0,
30.0,
31.0,
32.0,
33.0,
34.0,
35.0
0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0,
19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0, 33.0, 34.0, 35.0
],
"dims": [1, 3, 3, 4],
"type": "float32"
},
{
"data": [
1.0,
2.0,
3.0,
4.0,
5.0,
6.0,
7.0,
8.0,
9.0,
10.0,
11.0,
12.0
],
"data": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0],
"dims": [3, 1, 2, 2],
"type": "float32"
}
],
"outputs": [
{
"data": [
34,
44,
54,
74,
84,
94,
386,
412,
438,
490,
516,
542,
1122,
1164,
1206,
1290,
1332,
1374
],
"data": [34, 44, 54, 74, 84, 94, 386, 412, 438, 490, 516, 542, 1122, 1164, 1206, 1290, 1332, 1374],
"dims": [1, 3, 2, 3],
"type": "float32"
}
@ -431,63 +243,16 @@
"inputs": [
{
"data": [
0.0,
1.0,
2.0,
3.0,
4.0,
5.0,
6.0,
7.0,
8.0,
9.0,
10.0,
11.0,
12.0,
13.0,
14.0,
15.0,
16.0,
17.0,
18.0,
19.0,
20.0,
21.0,
22.0,
23.0,
24.0,
25.0,
26.0,
27.0,
28.0,
29.0,
30.0,
31.0
0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0,
19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0
],
"dims": [1, 8, 2, 2],
"type": "float32"
},
{
"data":[
0.0,
1.0,
2.0,
3.0,
4.0,
5.0,
6.0,
7.0,
8.0,
9.0,
10.0,
11.0,
12.0,
13.0,
14.0,
15.0
],
"dims":[2, 8, 1, 1],
"type":"float32"
"data": [0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0],
"dims": [2, 8, 1, 1],
"type": "float32"
},
{
"data": [0.5, 0.4],
@ -495,11 +260,9 @@
"type": "float32"
}
],
"outputs":[
"outputs": [
{
"data": [
560.5,588.5,616.5,644.5,1456.4,1548.4,1640.4,1732.4
],
"data": [560.5, 588.5, 616.5, 644.5, 1456.4, 1548.4, 1640.4, 1732.4],
"dims": [1, 2, 2, 2],
"type": "float32"
}

View file

@ -49,16 +49,7 @@
],
"outputs": [
{
"data": [
0.99500417,
0.98006658,
0.95533649,
0.92106099,
0.62160997,
0.69670671,
0.76484219,
0.82533561
],
"data": [0.99500417, 0.98006658, 0.95533649, 0.92106099, 0.62160997, 0.69670671, 0.76484219, 0.82533561],
"dims": [2, 4],
"type": "float32"
}

View file

@ -25,16 +25,20 @@
"name": "4D reshape [2, 8, 1, 2]",
"inputs": [
{
"data": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31],
"data": [
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
29, 30, 31
],
"dims": [2, 8, 1, 2],
"type": "float32"
}
],
"outputs": [
{
"data": [0, 4, 1, 5, 8, 12, 9, 13, 2, 6, 3, 7, 10, 14, 11, 15, 16, 20,
17, 21, 24, 28, 25, 29, 18, 22, 19, 23, 26, 30, 27, 31],
"data": [
0, 4, 1, 5, 8, 12, 9, 13, 2, 6, 3, 7, 10, 14, 11, 15, 16, 20, 17, 21, 24, 28, 25, 29, 18, 22, 19, 23, 26,
30, 27, 31
],
"dims": [2, 2, 2, 4],
"type": "float32"
}
@ -45,8 +49,10 @@
{
"name": "Depth-to-space of a 4-D tensor with DCR mode",
"operator": "DepthToSpace",
"attributes": [{ "name": "mode", "data": "DCR", "type": "string" },
{ "name": "blocksize", "data": 2, "type": "int" }],
"attributes": [
{ "name": "mode", "data": "DCR", "type": "string" },
{ "name": "blocksize", "data": 2, "type": "int" }
],
"cases": [
{
"name": "4D reshape [1, 8, 1, 1]",
@ -69,16 +75,20 @@
"name": "4D reshape [2, 8, 1, 2]",
"inputs": [
{
"data": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31],
"data": [
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
29, 30, 31
],
"dims": [2, 8, 1, 2],
"type": "float32"
}
],
"outputs": [
{
"data": [0, 4, 1, 5, 8, 12, 9, 13, 2, 6, 3, 7, 10, 14, 11, 15, 16, 20,
17, 21, 24, 28, 25, 29, 18, 22, 19, 23, 26, 30, 27, 31],
"data": [
0, 4, 1, 5, 8, 12, 9, 13, 2, 6, 3, 7, 10, 14, 11, 15, 16, 20, 17, 21, 24, 28, 25, 29, 18, 22, 19, 23, 26,
30, 27, 31
],
"dims": [2, 2, 2, 4],
"type": "float32"
}
@ -89,8 +99,10 @@
{
"name": "Depth-to-space of a 4-D tensor with CRD mode",
"operator": "DepthToSpace",
"attributes": [{ "name": "mode", "data": "CRD", "type": "string" },
{ "name": "blocksize", "data": 2, "type": "int" }],
"attributes": [
{ "name": "mode", "data": "CRD", "type": "string" },
{ "name": "blocksize", "data": 2, "type": "int" }
],
"cases": [
{
"name": "4D reshape [1, 8, 1, 1]",
@ -113,16 +125,20 @@
"name": "4D reshape [2, 8, 1, 2]",
"inputs": [
{
"data": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31],
"data": [
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
29, 30, 31
],
"dims": [2, 8, 1, 2],
"type": "float32"
}
],
"outputs": [
{
"data": [0, 2, 1, 3, 4, 6, 5, 7, 8, 10, 9, 11, 12, 14, 13, 15, 16, 18,
17, 19, 20, 22, 21, 23, 24, 26, 25, 27, 28, 30, 29, 31],
"data": [
0, 2, 1, 3, 4, 6, 5, 7, 8, 10, 9, 11, 12, 14, 13, 15, 16, 18, 17, 19, 20, 22, 21, 23, 24, 26, 25, 27, 28,
30, 29, 31
],
"dims": [2, 2, 2, 4],
"type": "float32"
}

View file

@ -79,32 +79,7 @@
"type": "float32"
},
{
"data": [
2,
6,
1,
2,
1,
3,
1,
4,
3,
5,
3,
4,
1,
4,
1,
6,
4,
4,
5,
6,
2,
4,
2,
6
],
"data": [2, 6, 1, 2, 1, 3, 1, 4, 3, 5, 3, 4, 1, 4, 1, 6, 4, 4, 5, 6, 2, 4, 2, 6],
"dims": [3, 2, 4],
"type": "float32"
}
@ -112,30 +87,8 @@
"outputs": [
{
"data": [
0.5,
0.3333,
3,
2,
5,
2,
7,
2,
0.3333,
0.4,
1,
1,
5,
1.5,
7,
1.3333,
0.25,
0.5,
0.6,
0.6667,
2.5,
1.5,
3.5,
1.3333
0.5, 0.3333, 3, 2, 5, 2, 7, 2, 0.3333, 0.4, 1, 1, 5, 1.5, 7, 1.3333, 0.25, 0.5, 0.6, 0.6667, 2.5, 1.5,
3.5, 1.3333
],
"dims": [3, 2, 4],
"type": "float32"

View file

@ -49,16 +49,7 @@
],
"outputs": [
{
"data": [
2.71828183,
7.3890561,
2.71828183,
20.08553692,
7.3890561,
20.08553692,
2.71828183,
7.3890561
],
"data": [2.71828183, 7.3890561, 2.71828183, 20.08553692, 7.3890561, 20.08553692, 2.71828183, 7.3890561],
"dims": [2, 4],
"type": "float32"
}

View file

@ -9,81 +9,13 @@
"inputs": [
{
"data": [
1.764052391052246,
0.40015721321105957,
0.978738009929657,
2.2408931255340576,
1.8675580024719238,
-0.9772778749465942,
0.9500884413719177,
-0.15135720372200012,
-0.10321885347366333,
0.4105985164642334,
0.14404356479644775,
1.4542734622955322,
0.7610377073287964,
0.12167501449584961,
0.44386324286460876,
0.3336743414402008,
1.4940791130065918,
-0.2051582634449005,
0.3130677044391632,
-0.8540957570075989,
-2.5529897212982178,
0.653618574142456,
0.8644362092018127,
-0.7421650290489197,
2.269754648208618,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
100,
100,
100,
100,
100,
100,
100,
100,
100,
100,
100,
100,
100,
100,
100,
100,
100,
100,
100,
100,
100,
100,
100,
100,
100
1.764052391052246, 0.40015721321105957, 0.978738009929657, 2.2408931255340576, 1.8675580024719238,
-0.9772778749465942, 0.9500884413719177, -0.15135720372200012, -0.10321885347366333, 0.4105985164642334,
0.14404356479644775, 1.4542734622955322, 0.7610377073287964, 0.12167501449584961, 0.44386324286460876,
0.3336743414402008, 1.4940791130065918, -0.2051582634449005, 0.3130677044391632, -0.8540957570075989,
-2.5529897212982178, 0.653618574142456, 0.8644362092018127, -0.7421650290489197, 2.269754648208618, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 100, 100, 100, 100, 100, 100, 100,
100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100
],
"dims": [1, 3, 5, 5],
"type": "float32"
@ -102,81 +34,21 @@
"inputs": [
{
"data": [
1.764052391052246,
0.40015721321105957,
0.978738009929657,
2.2408931255340576,
1.8675580024719238,
-0.9772778749465942,
0.9500884413719177,
-0.15135720372200012,
-0.10321885347366333,
0.4105985164642334,
0.14404356479644775,
1.4542734622955322,
0.7610377073287964,
0.12167501449584961,
0.44386324286460876,
0.3336743414402008,
1.4940791130065918,
-0.2051582634449005,
0.3130677044391632,
-0.8540957570075989,
-2.5529897212982178,
0.653618574142456,
0.8644362092018127,
-0.7421650290489197,
2.269754648208618,
-1.4543657302856445,
0.04575851559638977,
-0.18718385696411133,
1.5327792167663574,
1.4693588018417358,
0.154947429895401,
0.37816253304481506,
-0.8877857327461243,
-1.980796456336975,
-0.34791216254234314,
0.15634897351264954,
1.2302906513214111,
1.202379822731018,
-0.38732680678367615,
-0.302302747964859,
-1.0485529899597168,
-1.420017957687378,
-1.7062702178955078,
1.950775384902954,
-0.5096521973609924,
-0.4380742907524109,
-1.2527953386306763,
0.7774903774261475,
-1.6138978004455566,
-0.21274028718471527,
-0.8954665660858154,
0.38690251111984253,
-0.5108051300048828,
-1.18063223361969,
-0.02818222902715206,
0.4283318817615509,
0.06651721894741058,
0.30247190594673157,
-0.6343221068382263,
-0.3627411723136902,
-0.6724604368209839,
-0.35955315828323364,
-0.8131462931632996,
-1.7262825965881348,
0.17742614448070526,
-0.4017809331417084,
-1.630198359489441,
0.46278226375579834,
-0.9072983860969543,
0.05194539576768875,
0.7290905714035034,
0.12898291647434235,
1.1394007205963135,
-1.234825849533081,
0.4023416340351105
1.764052391052246, 0.40015721321105957, 0.978738009929657, 2.2408931255340576, 1.8675580024719238,
-0.9772778749465942, 0.9500884413719177, -0.15135720372200012, -0.10321885347366333, 0.4105985164642334,
0.14404356479644775, 1.4542734622955322, 0.7610377073287964, 0.12167501449584961, 0.44386324286460876,
0.3336743414402008, 1.4940791130065918, -0.2051582634449005, 0.3130677044391632, -0.8540957570075989,
-2.5529897212982178, 0.653618574142456, 0.8644362092018127, -0.7421650290489197, 2.269754648208618,
-1.4543657302856445, 0.04575851559638977, -0.18718385696411133, 1.5327792167663574, 1.4693588018417358,
0.154947429895401, 0.37816253304481506, -0.8877857327461243, -1.980796456336975, -0.34791216254234314,
0.15634897351264954, 1.2302906513214111, 1.202379822731018, -0.38732680678367615, -0.302302747964859,
-1.0485529899597168, -1.420017957687378, -1.7062702178955078, 1.950775384902954, -0.5096521973609924,
-0.4380742907524109, -1.2527953386306763, 0.7774903774261475, -1.6138978004455566, -0.21274028718471527,
-0.8954665660858154, 0.38690251111984253, -0.5108051300048828, -1.18063223361969, -0.02818222902715206,
0.4283318817615509, 0.06651721894741058, 0.30247190594673157, -0.6343221068382263, -0.3627411723136902,
-0.6724604368209839, -0.35955315828323364, -0.8131462931632996, -1.7262825965881348, 0.17742614448070526,
-0.4017809331417084, -1.630198359489441, 0.46278226375579834, -0.9072983860969543, 0.05194539576768875,
0.7290905714035034, 0.12898291647434235, 1.1394007205963135, -1.234825849533081, 0.4023416340351105
],
"dims": [1, 3, 5, 5],
"type": "float32"
@ -184,11 +56,7 @@
],
"outputs": [
{
"data": [
0.47517386078834534,
-0.19405530393123627,
-0.2832600772380829
],
"data": [0.47517386078834534, -0.19405530393123627, -0.2832600772380829],
"dims": [1, 3, 1, 1],
"type": "float32"
}

View file

@ -11,32 +11,7 @@
"name": "T[1,2,3,4]",
"inputs": [
{
"data": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11
],
"data": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
"dims": [1, 2, 3, 4],
"type": "float32"
}
@ -44,30 +19,11 @@
"outputs": [
{
"data": [
0.0,
0.003921568859368563,
0.007843137718737125,
0.011764706578105688,
0.01568627543747425,
0.019607844296842813,
0.023529413156211376,
0.02745098201557994,
0.0313725508749485,
0.035294119734317064,
0.03921568859368563,
0.04313725745305419,
0.0,
0.003921568859368563,
0.007843137718737125,
0.011764706578105688,
0.01568627543747425,
0.019607844296842813,
0.023529413156211376,
0.02745098201557994,
0.0313725508749485,
0.035294119734317064,
0.03921568859368563,
0.04313725745305419
0.0, 0.003921568859368563, 0.007843137718737125, 0.011764706578105688, 0.01568627543747425,
0.019607844296842813, 0.023529413156211376, 0.02745098201557994, 0.0313725508749485, 0.035294119734317064,
0.03921568859368563, 0.04313725745305419, 0.0, 0.003921568859368563, 0.007843137718737125,
0.011764706578105688, 0.01568627543747425, 0.019607844296842813, 0.023529413156211376,
0.02745098201557994, 0.0313725508749485, 0.035294119734317064, 0.03921568859368563, 0.04313725745305419
],
"dims": [1, 2, 3, 4],
"type": "float32"

View file

@ -49,16 +49,7 @@
],
"outputs": [
{
"data": [
0.0,
0.69314718,
0.0,
1.09861229,
0.69314718,
1.09861229,
0.0,
0.69314718
],
"data": [0.0, 0.69314718, 0.0, 1.09861229, 0.69314718, 1.09861229, 0.0, 0.69314718],
"dims": [2, 4],
"type": "float32"
}

View file

@ -74,18 +74,14 @@
"name": "multiplies 3D tensors",
"inputs": [
{
"data": [
1, 2, 3, 4, 5, 6, 7, 8, 17, 18, 19, 20, 21, 22, 23, 24, 9, 10, 11,
12, 13, 14, 15, 16
],
"data": [1, 2, 3, 4, 5, 6, 7, 8, 17, 18, 19, 20, 21, 22, 23, 24, 9, 10, 11, 12, 13, 14, 15, 16],
"dims": [3, 2, 4],
"type": "float32"
},
{
"data": [
13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 1, 2, 3, 4, 5, 6,
7, 8, 9, 10, 11, 12, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
36
13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 25, 26, 27, 28, 29,
30, 31, 32, 33, 34, 35, 36
],
"dims": [3, 4, 3],
"type": "float32"
@ -93,10 +89,7 @@
],
"outputs": [
{
"data": [
190, 200, 210, 470, 496, 522, 422, 496, 570, 510, 600, 690, 1254,
1296, 1338, 1726, 1784, 1842
],
"data": [190, 200, 210, 470, 496, 522, 422, 496, 570, 510, 600, 690, 1254, 1296, 1338, 1726, 1784, 1842],
"dims": [3, 2, 3],
"type": "float32"
}
@ -107,23 +100,19 @@
"inputs": [
{
"data": [
37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68,
69, 70, 71, 72, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
32, 33, 34, 35, 36
37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36
],
"dims": [2, 3, 4, 3],
"type": "float32"
},
{
"data": [
46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 1, 2, 3, 4, 5,
6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
39, 40, 41, 42, 43, 44, 45
46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
37, 38, 39, 40, 41, 42, 43, 44, 45
],
"dims": [2, 3, 3, 5],
"type": "float32"
@ -132,18 +121,13 @@
"outputs": [
{
"data": [
5824, 5938, 6052, 6166, 6280, 6283, 6406, 6529, 6652, 6775, 6742,
6874, 7006, 7138, 7270, 7201, 7342, 7483, 7624, 7765, 9910, 10060,
10210, 10360, 10510, 10504, 10663, 10822, 10981, 11140, 11098,
11266, 11434, 11602, 11770, 11692, 11869, 12046, 12223, 12400,
15076, 15262, 15448, 15634, 15820, 15805, 16000, 16195, 16390,
16585, 16534, 16738, 16942, 17146, 17350, 17263, 17476, 17689,
17902, 18115, 46, 52, 58, 64, 70, 100, 115, 130, 145, 160, 154,
178, 202, 226, 250, 208, 241, 274, 307, 340, 892, 934, 976, 1018,
1060, 1081, 1132, 1183, 1234, 1285, 1270, 1330, 1390, 1450, 1510,
1459, 1528, 1597, 1666, 1735, 2818, 2896, 2974, 3052, 3130, 3142,
3229, 3316, 3403, 3490, 3466, 3562, 3658, 3754, 3850, 3790, 3895,
4000, 4105, 4210
5824, 5938, 6052, 6166, 6280, 6283, 6406, 6529, 6652, 6775, 6742, 6874, 7006, 7138, 7270, 7201, 7342,
7483, 7624, 7765, 9910, 10060, 10210, 10360, 10510, 10504, 10663, 10822, 10981, 11140, 11098, 11266,
11434, 11602, 11770, 11692, 11869, 12046, 12223, 12400, 15076, 15262, 15448, 15634, 15820, 15805, 16000,
16195, 16390, 16585, 16534, 16738, 16942, 17146, 17350, 17263, 17476, 17689, 17902, 18115, 46, 52, 58, 64,
70, 100, 115, 130, 145, 160, 154, 178, 202, 226, 250, 208, 241, 274, 307, 340, 892, 934, 976, 1018, 1060,
1081, 1132, 1183, 1234, 1285, 1270, 1330, 1390, 1450, 1510, 1459, 1528, 1597, 1666, 1735, 2818, 2896,
2974, 3052, 3130, 3142, 3229, 3316, 3403, 3490, 3466, 3562, 3658, 3754, 3850, 3790, 3895, 4000, 4105, 4210
],
"dims": [2, 3, 4, 5],
"type": "float32"
@ -160,20 +144,15 @@
},
{
"data": [
49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110,
111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123,
124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136,
137, 138, 139, 140, 141, 142, 143, 144, 1, 2, 3, 4, 5, 6, 7, 8, 9,
10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
42, 43, 44, 45, 46, 47, 48, 145, 146, 147, 148, 149, 150, 151,
152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164,
165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177,
178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190,
191, 192
49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100,
101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121,
122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142,
143, 144, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 145, 146, 147,
148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168,
169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189,
190, 191, 192
],
"dims": [4, 3, 2, 4, 2],
"type": "float32"
@ -182,14 +161,11 @@
"outputs": [
{
"data": [
369, 376, 414, 422, 425, 432, 478, 486, 481, 488, 542, 550, 537,
544, 606, 614, 593, 600, 670, 678, 649, 656, 734, 742, 705, 712,
798, 806, 761, 768, 862, 870, 817, 824, 926, 934, 873, 880, 990,
998, 929, 936, 1054, 1062, 985, 992, 1118, 1126, 33, 40, 30, 38,
89, 96, 94, 102, 145, 152, 158, 166, 201, 208, 222, 230, 257, 264,
286, 294, 313, 320, 350, 358, 1041, 1048, 1182, 1190, 1097, 1104,
1246, 1254, 1153, 1160, 1310, 1318, 1209, 1216, 1374, 1382, 1265,
1272, 1438, 1446, 1321, 1328, 1502, 1510
369, 376, 414, 422, 425, 432, 478, 486, 481, 488, 542, 550, 537, 544, 606, 614, 593, 600, 670, 678, 649,
656, 734, 742, 705, 712, 798, 806, 761, 768, 862, 870, 817, 824, 926, 934, 873, 880, 990, 998, 929, 936,
1054, 1062, 985, 992, 1118, 1126, 33, 40, 30, 38, 89, 96, 94, 102, 145, 152, 158, 166, 201, 208, 222, 230,
257, 264, 286, 294, 313, 320, 350, 358, 1041, 1048, 1182, 1190, 1097, 1104, 1246, 1254, 1153, 1160, 1310,
1318, 1209, 1216, 1374, 1382, 1265, 1272, 1438, 1446, 1321, 1328, 1502, 1510
],
"dims": [4, 3, 2, 2, 2],
"type": "float32"
@ -200,29 +176,21 @@
"name": "multiplies 4D broadcasted to 5D tensors",
"inputs": [
{
"data": [
1, 2, 3, 4, 5, 6, 7, 8, 17, 18, 19, 20, 21, 22, 23, 24, 9, 10, 11,
12, 13, 14, 15, 16
],
"data": [1, 2, 3, 4, 5, 6, 7, 8, 17, 18, 19, 20, 21, 22, 23, 24, 9, 10, 11, 12, 13, 14, 15, 16],
"dims": [3, 1, 2, 4],
"type": "float32"
},
{
"data": [
49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110,
111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123,
124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136,
137, 138, 139, 140, 141, 142, 143, 144, 1, 2, 3, 4, 5, 6, 7, 8, 9,
10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
42, 43, 44, 45, 46, 47, 48, 145, 146, 147, 148, 149, 150, 151,
152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164,
165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177,
178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190,
191, 192
49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100,
101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121,
122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142,
143, 144, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 145, 146, 147,
148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168,
169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189,
190, 191, 192
],
"dims": [4, 3, 2, 4, 2],
"type": "float32"
@ -231,14 +199,11 @@
"outputs": [
{
"data": [
530, 540, 1362, 1388, 610, 620, 1570, 1596, 5042, 5116, 6130,
6220, 5634, 5708, 6850, 6940, 3538, 3580, 4882, 4940, 3874, 3916,
5346, 5404, 1010, 1020, 2610, 2636, 1090, 1100, 2818, 2844, 8594,
8668, 10450, 10540, 9186, 9260, 11170, 11260, 5554, 5596, 7666,
7724, 5890, 5932, 8130, 8188, 50, 60, 114, 140, 130, 140, 322,
348, 1490, 1564, 1810, 1900, 2082, 2156, 2530, 2620, 1522, 1564,
2098, 2156, 1858, 1900, 2562, 2620, 1490, 1500, 3858, 3884, 1570,
1580, 4066, 4092, 12146, 12220, 14770, 14860, 12738, 12812, 15490,
530, 540, 1362, 1388, 610, 620, 1570, 1596, 5042, 5116, 6130, 6220, 5634, 5708, 6850, 6940, 3538, 3580,
4882, 4940, 3874, 3916, 5346, 5404, 1010, 1020, 2610, 2636, 1090, 1100, 2818, 2844, 8594, 8668, 10450,
10540, 9186, 9260, 11170, 11260, 5554, 5596, 7666, 7724, 5890, 5932, 8130, 8188, 50, 60, 114, 140, 130,
140, 322, 348, 1490, 1564, 1810, 1900, 2082, 2156, 2530, 2620, 1522, 1564, 2098, 2156, 1858, 1900, 2562,
2620, 1490, 1500, 3858, 3884, 1570, 1580, 4066, 4092, 12146, 12220, 14770, 14860, 12738, 12812, 15490,
15580, 7570, 7612, 10450, 10508, 7906, 7948, 10914, 10972
],
"dims": [4, 3, 2, 2, 2],
@ -251,12 +216,10 @@
"inputs": [
{
"data": [
73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
89, 90, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
66, 67, 68, 69, 70, 71, 72
73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
64, 65, 66, 67, 68, 69, 70, 71, 72
],
"dims": [5, 3, 1, 2, 3],
"type": "float32"
@ -270,19 +233,14 @@
"outputs": [
{
"data": [
1342, 1564, 1786, 2008, 2230, 1396, 1627, 1858, 2089, 2320, 1450,
1690, 1930, 2170, 2410, 1504, 1753, 2002, 2251, 2500, 1558, 1816,
2074, 2332, 2590, 1612, 1879, 2146, 2413, 2680, 46, 52, 58, 64,
70, 100, 115, 130, 145, 160, 154, 178, 202, 226, 250, 208, 241,
274, 307, 340, 262, 304, 346, 388, 430, 316, 367, 418, 469, 520,
370, 430, 490, 550, 610, 424, 493, 562, 631, 700, 478, 556, 634,
712, 790, 532, 619, 706, 793, 880, 586, 682, 778, 874, 970, 640,
745, 850, 955, 1060, 694, 808, 922, 1036, 1150, 748, 871, 994,
1117, 1240, 802, 934, 1066, 1198, 1330, 856, 997, 1138, 1279,
1420, 910, 1060, 1210, 1360, 1510, 964, 1123, 1282, 1441, 1600,
1018, 1186, 1354, 1522, 1690, 1072, 1249, 1426, 1603, 1780, 1126,
1312, 1498, 1684, 1870, 1180, 1375, 1570, 1765, 1960, 1234, 1438,
1642, 1846, 2050, 1288, 1501, 1714, 1927, 2140
1342, 1564, 1786, 2008, 2230, 1396, 1627, 1858, 2089, 2320, 1450, 1690, 1930, 2170, 2410, 1504, 1753,
2002, 2251, 2500, 1558, 1816, 2074, 2332, 2590, 1612, 1879, 2146, 2413, 2680, 46, 52, 58, 64, 70, 100,
115, 130, 145, 160, 154, 178, 202, 226, 250, 208, 241, 274, 307, 340, 262, 304, 346, 388, 430, 316, 367,
418, 469, 520, 370, 430, 490, 550, 610, 424, 493, 562, 631, 700, 478, 556, 634, 712, 790, 532, 619, 706,
793, 880, 586, 682, 778, 874, 970, 640, 745, 850, 955, 1060, 694, 808, 922, 1036, 1150, 748, 871, 994,
1117, 1240, 802, 934, 1066, 1198, 1330, 856, 997, 1138, 1279, 1420, 910, 1060, 1210, 1360, 1510, 964,
1123, 1282, 1441, 1600, 1018, 1186, 1354, 1522, 1690, 1072, 1249, 1426, 1603, 1780, 1126, 1312, 1498,
1684, 1870, 1180, 1375, 1570, 1765, 1960, 1234, 1438, 1642, 1846, 2050, 1288, 1501, 1714, 1927, 2140
],
"dims": [5, 3, 1, 2, 5],
"type": "float32"

View file

@ -79,64 +79,14 @@
"type": "float32"
},
{
"data": [
2,
6,
1,
2,
1,
3,
1,
4,
3,
5,
3,
4,
1,
4,
1,
6,
4,
4,
5,
6,
2,
4,
2,
6
],
"data": [2, 6, 1, 2, 1, 3, 1, 4, 3, 5, 3, 4, 1, 4, 1, 6, 4, 4, 5, 6, 2, 4, 2, 6],
"dims": [3, 2, 4],
"type": "float32"
}
],
"outputs": [
{
"data": [
2,
12,
3,
8,
5,
18,
7,
32,
3,
10,
9,
16,
5,
24,
7,
48,
4,
8,
15,
24,
10,
24,
14,
48
],
"data": [2, 12, 3, 8, 5, 18, 7, 32, 3, 10, 9, 16, 5, 24, 7, 48, 4, 8, 15, 24, 10, 24, 14, 48],
"dims": [3, 2, 4],
"type": "float32"
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -14,32 +14,7 @@
"type": "float32"
},
{
"data": [
2,
6,
1,
2,
1,
3,
1,
4,
3,
5,
3,
4,
1,
4,
1,
6,
4,
4,
5,
6,
2,
4,
2,
6
],
"data": [2, 6, 1, 2, 1, 3, 1, 4, 3, 5, 3, 4, 1, 4, 1, 6, 4, 4, 5, 6, 2, 4, 2, 6],
"dims": [3, 2, 4],
"type": "float32"
}
@ -47,30 +22,7 @@
"outputs": [
{
"data": [
1,
64,
3,
16,
5,
216,
7,
4096,
1,
32,
27,
256,
5,
1296,
7,
262144,
1,
16,
243,
4096,
25,
1296,
49,
262144
1, 64, 3, 16, 5, 216, 7, 4096, 1, 32, 27, 256, 5, 1296, 7, 262144, 1, 16, 243, 4096, 25, 1296, 49, 262144
],
"dims": [3, 2, 4],
"type": "float32"

View file

@ -43,24 +43,7 @@
],
"outputs": [
{
"data": [
1,
1.25,
1.75,
2,
1.5,
1.75,
2.25,
2.5,
2.5,
2.75,
3.25,
3.5,
3,
3.25,
3.75,
4
],
"data": [1, 1.25, 1.75, 2, 1.5, 1.75, 2.25, 2.5, 2.5, 2.75, 3.25, 3.5, 3, 3.25, 3.75, 4],
"dims": [1, 1, 4, 4],
"type": "float32"
}
@ -111,24 +94,7 @@
],
"outputs": [
{
"data": [
1,
1.3333,
1.6666,
2,
1.6666,
2,
2.3333,
2.6666,
2.3333,
2.6666,
3,
3.3333,
3,
3.3333,
3.6666,
4
],
"data": [1, 1.3333, 1.6666, 2, 1.6666, 2, 2.3333, 2.6666, 2.3333, 2.6666, 3, 3.3333, 3, 3.3333, 3.6666, 4],
"dims": [1, 1, 4, 4],
"type": "float32"
}
@ -179,24 +145,7 @@
],
"outputs": [
{
"data": [
1.0,
1.5,
2.0,
2.0,
2.0,
2.5,
3.0,
3.0,
3.0,
3.5,
4.0,
4.0,
3.0,
3.5,
4.0,
4.0
],
"data": [1.0, 1.5, 2.0, 2.0, 2.0, 2.5, 3.0, 3.0, 3.0, 3.5, 4.0, 4.0, 3.0, 3.5, 4.0, 4.0],
"dims": [1, 1, 4, 4],
"type": "float32"
}
@ -228,24 +177,7 @@
],
"outputs": [
{
"data": [
1.0,
1.5,
2.0,
2.0,
2.0,
2.5,
3.0,
3.0,
3.0,
3.5,
4.0,
4.0,
3.0,
3.5,
4.0,
4.0
],
"data": [1.0, 1.5, 2.0, 2.0, 2.0, 2.5, 3.0, 3.0, 3.0, 3.5, 4.0, 4.0, 3.0, 3.5, 4.0, 4.0],
"dims": [1, 1, 4, 4],
"type": "float32"
}
@ -273,78 +205,10 @@
"outputs": [
{
"data": [
1.0,
1.5,
2.0,
2.5,
3.0,
3.0,
2.0,
2.5,
3.0,
3.5,
4.0,
4,
3.0,
3.5,
4.0,
4.5,
5.0,
5.0,
4.0,
4.5,
5.0,
5.5,
6.0,
6.0,
5.0,
5.5,
6.0,
6.5,
7.0,
7.0,
6.0,
6.5,
7.0,
7.5,
8.0,
8.0,
7.0,
7.5,
8.0,
8.5,
9.0,
9.0,
8.0,
8.5,
9.0,
9.5,
10.0,
10.0,
9.0,
9.5,
10.0,
10.5,
11.0,
11.0,
10.0,
10.5,
11.0,
11.5,
12.0,
12.0,
10.0,
10.5,
11.0,
11.5,
12.0,
12.0,
10.0,
10.5,
11.0,
11.5,
12.0,
12.0
1.0, 1.5, 2.0, 2.5, 3.0, 3.0, 2.0, 2.5, 3.0, 3.5, 4.0, 4, 3.0, 3.5, 4.0, 4.5, 5.0, 5.0, 4.0, 4.5, 5.0,
5.5, 6.0, 6.0, 5.0, 5.5, 6.0, 6.5, 7.0, 7.0, 6.0, 6.5, 7.0, 7.5, 8.0, 8.0, 7.0, 7.5, 8.0, 8.5, 9.0, 9.0,
8.0, 8.5, 9.0, 9.5, 10.0, 10.0, 9.0, 9.5, 10.0, 10.5, 11.0, 11.0, 10.0, 10.5, 11.0, 11.5, 12.0, 12.0,
10.0, 10.5, 11.0, 11.5, 12.0, 12.0, 10.0, 10.5, 11.0, 11.5, 12.0, 12.0
],
"dims": [1, 1, 12, 6],
"type": "float32"
@ -373,54 +237,9 @@
"outputs": [
{
"data": [
1.0,
1.5,
2.0,
2.0,
2.0,
2.5,
3.0,
3.0,
3.0,
3.5,
4.0,
4.0,
4.0,
4.5,
5.0,
5.0,
5.0,
5.5,
6.0,
6.0,
5.0,
5.5,
6.0,
6.0,
7.0,
7.5,
8.0,
8.0,
8.0,
8.5,
9.0,
9.0,
9.0,
9.5,
10.0,
10.0,
10.0,
10.5,
11.0,
11.0,
11.0,
11.5,
12.0,
12.0,
11.0,
11.5,
12.0,
12.0
1.0, 1.5, 2.0, 2.0, 2.0, 2.5, 3.0, 3.0, 3.0, 3.5, 4.0, 4.0, 4.0, 4.5, 5.0, 5.0, 5.0, 5.5, 6.0, 6.0, 5.0,
5.5, 6.0, 6.0, 7.0, 7.5, 8.0, 8.0, 8.0, 8.5, 9.0, 9.0, 9.0, 9.5, 10.0, 10.0, 10.0, 10.5, 11.0, 11.0, 11.0,
11.5, 12.0, 12.0, 11.0, 11.5, 12.0, 12.0
],
"dims": [1, 2, 6, 4],
"type": "float32"

View file

@ -49,16 +49,7 @@
],
"outputs": [
{
"data": [
0.0998,
0.1987,
0.2955,
0.3894,
0.7833,
0.7173,
0.6442,
0.5646
],
"data": [0.0998, 0.1987, 0.2955, 0.3894, 0.7833, 0.7173, 0.6442, 0.5646],
"dims": [2, 4],
"type": "float32"
}

View file

@ -15,12 +15,7 @@
],
"outputs": [
{
"data": [
0.2689414322376251,
0.7310585975646973,
0.2689414322376251,
0.7310585975646973
],
"data": [0.2689414322376251, 0.7310585975646973, 0.2689414322376251, 0.7310585975646973],
"dims": [2, 2],
"type": "float32"
}

View file

@ -2,7 +2,7 @@
{
"name": "Split on Axis 0",
"operator": "Split",
"opsets": [{"domain": "", "version": 12}],
"opsets": [{ "domain": "", "version": 12 }],
"attributes": [
{ "name": "axis", "data": 0, "type": "int" },
{ "name": "split", "data": [2, 4], "type": "ints" }
@ -35,7 +35,7 @@
{
"name": "Split on Axis 1 - 2D",
"operator": "Split",
"opsets": [{"domain": "", "version": 12}],
"opsets": [{ "domain": "", "version": 12 }],
"attributes": [
{ "name": "axis", "data": 1, "type": "int" },
{ "name": "split", "data": [2, 4], "type": "ints" }
@ -45,20 +45,7 @@
"name": "T[6]",
"inputs": [
{
"data": [
1.0,
2.0,
3.0,
4.0,
5.0,
6.0,
7.0,
8.0,
9.0,
10.0,
11.0,
12.0
],
"data": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0],
"dims": [2, 6],
"type": "float32"
}

View file

@ -79,64 +79,14 @@
"type": "float32"
},
{
"data": [
2,
6,
1,
2,
1,
3,
1,
4,
3,
5,
3,
4,
1,
4,
1,
6,
4,
4,
5,
6,
2,
4,
2,
6
],
"data": [2, 6, 1, 2, 1, 3, 1, 4, 3, 5, 3, 4, 1, 4, 1, 6, 4, 4, 5, 6, 2, 4, 2, 6],
"dims": [3, 2, 4],
"type": "float32"
}
],
"outputs": [
{
"data": [
-1,
-4,
2,
2,
4,
3,
6,
4,
-2,
-3,
0,
0,
4,
2,
6,
2,
-3,
-2,
-2,
-2,
3,
2,
5,
2
],
"data": [-1, -4, 2, 2, 4, 3, 6, 4, -2, -3, 0, 0, 4, 2, 6, 2, -3, -2, -2, -2, 3, 2, 5, 2],
"dims": [3, 2, 4],
"type": "float32"
}

View file

@ -49,16 +49,7 @@
],
"outputs": [
{
"data": [
0.10033467,
0.20271004,
0.30933625,
0.42279322,
1.26015822,
1.02963856,
0.84228838,
0.68413681
],
"data": [0.10033467, 0.20271004, 0.30933625, 0.42279322, 1.26015822, 1.02963856, 0.84228838, 0.68413681],
"dims": [2, 4],
"type": "float32"
}

View file

@ -32,64 +32,14 @@
"name": "T[2,3]",
"inputs": [
{
"data": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24
],
"data": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24],
"dims": [2, 3, 4],
"type": "float32"
}
],
"outputs": [
{
"data": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24
],
"data": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24],
"dims": [2, 3, 4],
"type": "float32"
}
@ -106,64 +56,14 @@
"name": "T[2,3]",
"inputs": [
{
"data": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24
],
"data": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24],
"dims": [2, 3, 4],
"type": "float32"
}
],
"outputs": [
{
"data": [
1,
5,
9,
2,
6,
10,
3,
7,
11,
4,
8,
12,
13,
17,
21,
14,
18,
22,
15,
19,
23,
16,
20,
24
],
"data": [1, 5, 9, 2, 6, 10, 3, 7, 11, 4, 8, 12, 13, 17, 21, 14, 18, 22, 15, 19, 23, 16, 20, 24],
"dims": [2, 4, 3],
"type": "float32"
}
@ -180,64 +80,14 @@
"name": "T[2,3]",
"inputs": [
{
"data": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24
],
"data": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24],
"dims": [2, 3, 4],
"type": "float32"
}
],
"outputs": [
{
"data": [
1,
13,
5,
17,
9,
21,
2,
14,
6,
18,
10,
22,
3,
15,
7,
19,
11,
23,
4,
16,
8,
20,
12,
24
],
"data": [1, 13, 5, 17, 9, 21, 2, 14, 6, 18, 10, 22, 3, 15, 7, 19, 11, 23, 4, 16, 8, 20, 12, 24],
"dims": [4, 3, 2],
"type": "float32"
}
@ -254,64 +104,14 @@
"name": "T[2,3]",
"inputs": [
{
"data": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24
],
"data": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24],
"dims": [2, 3, 4],
"type": "float32"
}
],
"outputs": [
{
"data": [
1,
5,
9,
13,
17,
21,
2,
6,
10,
14,
18,
22,
3,
7,
11,
15,
19,
23,
4,
8,
12,
16,
20,
24
],
"data": [1, 5, 9, 13, 17, 21, 2, 6, 10, 14, 18, 22, 3, 7, 11, 15, 19, 23, 4, 8, 12, 16, 20, 24],
"dims": [4, 2, 3],
"type": "float32"
}
@ -328,64 +128,14 @@
"name": "T[2,3]",
"inputs": [
{
"data": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24
],
"data": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24],
"dims": [2, 3, 4],
"type": "float32"
}
],
"outputs": [
{
"data": [
1,
13,
2,
14,
3,
15,
4,
16,
5,
17,
6,
18,
7,
19,
8,
20,
9,
21,
10,
22,
11,
23,
12,
24
],
"data": [1, 13, 2, 14, 3, 15, 4, 16, 5, 17, 6, 18, 7, 19, 8, 20, 9, 21, 10, 22, 11, 23, 12, 24],
"dims": [3, 4, 2],
"type": "float32"
}
@ -402,64 +152,14 @@
"name": "T[2,3]",
"inputs": [
{
"data": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24
],
"data": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24],
"dims": [2, 3, 4],
"type": "float32"
}
],
"outputs": [
{
"data": [
1,
2,
3,
4,
13,
14,
15,
16,
5,
6,
7,
8,
17,
18,
19,
20,
9,
10,
11,
12,
21,
22,
23,
24
],
"data": [1, 2, 3, 4, 13, 14, 15, 16, 5, 6, 7, 8, 17, 18, 19, 20, 9, 10, 11, 12, 21, 22, 23, 24],
"dims": [3, 2, 4],
"type": "float32"
}

View file

@ -2,9 +2,7 @@
{
"name": "Upsample - Nearest",
"operator": "Upsample",
"attributes": [
{ "name": "scales", "data": [1.0, 1.0, 2.0, 3.0], "type": "floats" }
],
"attributes": [{ "name": "scales", "data": [1.0, 1.0, 2.0, 3.0], "type": "floats" }],
"cases": [
{
"name": "X",
@ -18,55 +16,11 @@
"outputs": [
{
"data": [
1.0,
1.0,
1.0,
3.0,
3.0,
3.0,
1.0,
1.0,
1.0,
3.0,
3.0,
3.0,
3.0,
3.0,
3.0,
5.0,
5.0,
5.0,
3.0,
3.0,
3.0,
5.0,
5.0,
5.0,
1.0, 1.0, 1.0, 3.0, 3.0, 3.0, 1.0, 1.0, 1.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 5.0, 5.0, 5.0, 3.0, 3.0, 3.0,
5.0, 5.0, 5.0,
3.0,
3.0,
3.0,
5.0,
5.0,
5.0,
3.0,
3.0,
3.0,
5.0,
5.0,
5.0,
7.0,
7.0,
7.0,
9.0,
9.0,
9.0,
7.0,
7.0,
7.0,
9.0,
9.0,
9.0
3.0, 3.0, 3.0, 5.0, 5.0, 5.0, 3.0, 3.0, 3.0, 5.0, 5.0, 5.0, 7.0, 7.0, 7.0, 9.0, 9.0, 9.0, 7.0, 7.0, 7.0,
9.0, 9.0, 9.0
],
"dims": [1, 2, 4, 6],
"type": "float32"
@ -78,9 +32,7 @@
{
"name": "Upsample - Nearest2X",
"operator": "Upsample",
"attributes": [
{ "name": "scales", "data": [1.0, 1.0, 2.0, 2.0], "type": "floats" }
],
"attributes": [{ "name": "scales", "data": [1.0, 1.0, 2.0, 2.0], "type": "floats" }],
"cases": [
{
"name": "X",
@ -94,39 +46,9 @@
"outputs": [
{
"data": [
1.0,
1.0,
3.0,
3.0,
1.0,
1.0,
3.0,
3.0,
3.0,
3.0,
5.0,
5.0,
3.0,
3.0,
5.0,
5.0,
1.0, 1.0, 3.0, 3.0, 1.0, 1.0, 3.0, 3.0, 3.0, 3.0, 5.0, 5.0, 3.0, 3.0, 5.0, 5.0,
3.0,
3.0,
5.0,
5.0,
3.0,
3.0,
5.0,
5.0,
7.0,
7.0,
9.0,
9.0,
7.0,
7.0,
9.0,
9.0
3.0, 3.0, 5.0, 5.0, 3.0, 3.0, 5.0, 5.0, 7.0, 7.0, 9.0, 9.0, 7.0, 7.0, 9.0, 9.0
],
"dims": [1, 2, 4, 4],
"type": "float32"
@ -138,9 +60,7 @@
{
"name": "Upsample - Nearest222X",
"operator": "Upsample",
"attributes": [
{ "name": "scales", "data": [2.0, 1.0, 2.0, 2.0], "type": "floats" }
],
"attributes": [{ "name": "scales", "data": [2.0, 1.0, 2.0, 2.0], "type": "floats" }],
"cases": [
{
"name": "X",
@ -154,73 +74,13 @@
"outputs": [
{
"data": [
1.0,
1.0,
3.0,
3.0,
1.0,
1.0,
3.0,
3.0,
3.0,
3.0,
5.0,
5.0,
3.0,
3.0,
5.0,
5.0,
1.0, 1.0, 3.0, 3.0, 1.0, 1.0, 3.0, 3.0, 3.0, 3.0, 5.0, 5.0, 3.0, 3.0, 5.0, 5.0,
3.0,
3.0,
5.0,
5.0,
3.0,
3.0,
5.0,
5.0,
7.0,
7.0,
9.0,
9.0,
7.0,
7.0,
9.0,
9.0,
3.0, 3.0, 5.0, 5.0, 3.0, 3.0, 5.0, 5.0, 7.0, 7.0, 9.0, 9.0, 7.0, 7.0, 9.0, 9.0,
1.0,
1.0,
3.0,
3.0,
1.0,
1.0,
3.0,
3.0,
3.0,
3.0,
5.0,
5.0,
3.0,
3.0,
5.0,
5.0,
1.0, 1.0, 3.0, 3.0, 1.0, 1.0, 3.0, 3.0, 3.0, 3.0, 5.0, 5.0, 3.0, 3.0, 5.0, 5.0,
3.0,
3.0,
5.0,
5.0,
3.0,
3.0,
5.0,
5.0,
7.0,
7.0,
9.0,
9.0,
7.0,
7.0,
9.0,
9.0
3.0, 3.0, 5.0, 5.0, 3.0, 3.0, 5.0, 5.0, 7.0, 7.0, 9.0, 9.0, 7.0, 7.0, 9.0, 9.0
],
"dims": [2, 2, 4, 4],
"type": "float32"
@ -232,9 +92,7 @@
{
"name": "Upsample - Nearest15X",
"operator": "Upsample",
"attributes": [
{ "name": "scales", "data": [1.0, 1.0, 2.0, 1.5], "type": "floats" }
],
"attributes": [{ "name": "scales", "data": [1.0, 1.0, 2.0, 1.5], "type": "floats" }],
"cases": [
{
"name": "X",
@ -248,31 +106,9 @@
"outputs": [
{
"data": [
1.0,
1.0,
3.0,
1.0,
1.0,
3.0,
3.0,
3.0,
5.0,
3.0,
3.0,
5.0,
1.0, 1.0, 3.0, 1.0, 1.0, 3.0, 3.0, 3.0, 5.0, 3.0, 3.0, 5.0,
3.0,
3.0,
5.0,
3.0,
3.0,
5.0,
7.0,
7.0,
9.0,
7.0,
7.0,
9.0
3.0, 3.0, 5.0, 3.0, 3.0, 5.0, 7.0, 7.0, 9.0, 7.0, 7.0, 9.0
],
"dims": [1, 2, 4, 3],
"type": "float32"
@ -328,71 +164,11 @@
"outputs": [
{
"data": [
1.0,
1.5,
2.0,
2.5,
3.0,
3.0,
3.0,
3.0,
2.0,
2.5,
3.0,
3.5,
4.0,
4.0,
4.0,
4.0,
3.0,
3.5,
4.0,
4.5,
5.0,
5.0,
5.0,
5.0,
3.0,
3.5,
4.0,
4.5,
5.0,
5.0,
5.0,
5.0,
1.0, 1.5, 2.0, 2.5, 3.0, 3.0, 3.0, 3.0, 2.0, 2.5, 3.0, 3.5, 4.0, 4.0, 4.0, 4.0, 3.0, 3.5, 4.0, 4.5, 5.0,
5.0, 5.0, 5.0, 3.0, 3.5, 4.0, 4.5, 5.0, 5.0, 5.0, 5.0,
3.0,
3.5,
4.0,
4.5,
5.0,
5.0,
5.0,
5.0,
5.0,
5.5,
6.0,
6.5,
7.0,
7.0,
7.0,
7.0,
7.0,
7.5,
8.0,
8.5,
9.0,
9.0,
9.0,
9.0,
7.0,
7.5,
8.0,
8.5,
9.0,
9.0,
9.0,
9.0
3.0, 3.5, 4.0, 4.5, 5.0, 5.0, 5.0, 5.0, 5.0, 5.5, 6.0, 6.5, 7.0, 7.0, 7.0, 7.0, 7.0, 7.5, 8.0, 8.5, 9.0,
9.0, 9.0, 9.0, 7.0, 7.5, 8.0, 8.5, 9.0, 9.0, 9.0, 9.0
],
"dims": [2, 1, 4, 8],
"type": "float32"
@ -421,38 +197,8 @@
"outputs": [
{
"data": [
1.0,
1.5,
2.0,
2.5,
3.0,
3.0,
3.0,
3.0,
2.0,
2.5,
3.0,
3.5,
4.0,
4.0,
4.0,
4.0,
3.0,
3.5,
4.0,
4.5,
5.0,
5.0,
5.0,
5.0,
3.0,
3.5,
4.0,
4.5,
5.0,
5.0,
5.0,
5.0
1.0, 1.5, 2.0, 2.5, 3.0, 3.0, 3.0, 3.0, 2.0, 2.5, 3.0, 3.5, 4.0, 4.0, 4.0, 4.0, 3.0, 3.5, 4.0, 4.5, 5.0,
5.0, 5.0, 5.0, 3.0, 3.5, 4.0, 4.5, 5.0, 5.0, 5.0, 5.0
],
"dims": [4, 8],
"type": "float32"

View file

@ -7,17 +7,15 @@ const IMAGE_HEIGHT = 20
const IMAGE_WIDTH = 15
function getRndColor() {
let r = 255*Math.random()|0,
g = 255*Math.random()|0,
b = 255*Math.random()|0,
a = 255*Math.random()|0;
return 'rgb(' + r + ',' + g + ',' + b + ',' + a +')';
let r = 255 * Math.random() | 0, g = 255 * Math.random() | 0, b = 255 * Math.random() | 0,
a = 255 * Math.random() | 0;
return 'rgb(' + r + ',' + g + ',' + b + ',' + a + ')';
}
function compareTensors(tensorA, tensorB, msg){
for (let i = 0; i < IMAGE_HEIGHT*IMAGE_WIDTH*3; i++) {
if(tensorA.data[i]!==tensorB.data[i]){
console.log("Element - " + i + " - " + tensorA.data[i] + " - " + tensorB.data[i]);
function compareTensors(tensorA, tensorB, msg) {
for (let i = 0; i < IMAGE_HEIGHT * IMAGE_WIDTH * 3; i++) {
if (tensorA.data[i] !== tensorB.data[i]) {
console.log('Element - ' + i + ' - ' + tensorA.data[i] + ' - ' + tensorB.data[i]);
throw new Error(msg);
}
}
@ -32,8 +30,7 @@ function compareTensors(tensorA, tensorB, msg){
// - the test is composed by 3 different test cases. split them to 3 different cases.
// - some test cases are wriiten incorrectly.
//
it('Browser E2E testing - Tensor <--> Image E2E test', async function () {
it('Browser E2E testing - Tensor <--> Image E2E test', async function() {
// Creating Image HTML Image Element
let img = new Image();
img.crossOrigin = 'Anonymous';
@ -46,32 +43,34 @@ it('Browser E2E testing - Tensor <--> Image E2E test', async function () {
let y, x;
// Filling the canvas with random data
for(y = 0; y < IMAGE_HEIGHT; y++) {
for(x = 0; x < IMAGE_WIDTH; x++) {
context.fillStyle = getRndColor();
context.fillRect(x, y, 1, 1);
}
for (y = 0; y < IMAGE_HEIGHT; y++) {
for (x = 0; x < IMAGE_WIDTH; x++) {
context.fillStyle = getRndColor();
context.fillRect(x, y, 1, 1);
}
}
// Copying the canavas data to the image
img.src = canvas.toDataURL();
// Testing HTML Image Element --> Tensor --> ImageData --> Tensor
img.onload = async () =>{
img.onload =
async () => {
// Image HTML element to tensor API - HTML
const inputTensorHTML = await ort.Tensor.fromImage(img, {norm:{bias:[2,3,9,5],mean:[5,6,17,8]}});
const inputTensorHTML = await ort.Tensor.fromImage(img, {norm: {bias: [2, 3, 9, 5], mean: [5, 6, 17, 8]}});
// Tensor to ImageDAta API
let newImage = inputTensorHTML.toImageData({norm:{bias:[2/5,3/6,9/17,5/8],mean:[5,6,17,8]}});
let newImage = inputTensorHTML.toImageData({norm: {bias: [2 / 5, 3 / 6, 9 / 17, 5 / 8], mean: [5, 6, 17, 8]}});
// ImageData to tensor API
let inputTensorImageData = await ort.Tensor.fromImage(newImage, options={norm:{bias:[2,3,9,5],mean:[5,6,17,8]}});
let inputTensorImageData =
await ort.Tensor.fromImage(newImage, options = {norm: {bias: [2, 3, 9, 5], mean: [5, 6, 17, 8]}});
// TODO: fix this test case
//
// the line above does not return as expected because syntax error.
// the reason why it does not fail is because it throws exception, and the exception is not caught. the line below is not executed.
// to fix this, wrap a try-catch to deal with exceptions.
// the reason why it does not fail is because it throws exception, and the exception is not caught. the line below
// is not executed. to fix this, wrap a try-catch to deal with exceptions.
compareTensors(inputTensorHTML,inputTensorImageData,'BUG in HTML image element & ImageData use case');
compareTensors(inputTensorHTML, inputTensorImageData, 'BUG in HTML image element & ImageData use case');
}
// Copying the canavas data to the image as Data URL
@ -79,30 +78,36 @@ it('Browser E2E testing - Tensor <--> Image E2E test', async function () {
// Testing Data URL --> Tensor --> Data URL --> Tensor
// Data URL to tensor API -
const inputTensorDataURL = await ort.Tensor.fromImage(image,{format:'RBG', norm:{bias:[1,10,5,0],mean:[5,7,11,0]}});
const inputTensorDataURL =
await ort.Tensor.fromImage(image, {format: 'RBG', norm: {bias: [1, 10, 5, 0], mean: [5, 7, 11, 0]}});
// Tensor to ImageDAta API
let newImage = inputTensorDataURL.toDataURL({norm:{bias:[1/5,10/7,5/11,0],mean:[5,7,11,0]}});
let newImage = inputTensorDataURL.toDataURL({norm: {bias: [1 / 5, 10 / 7, 5 / 11, 0], mean: [5, 7, 11, 0]}});
// ImageData to tensor API
let inputTensorImageData = await ort.Tensor.fromImage(newImage,{format:'RGBA', norm:{bias:[1,10,5,0],mean:[5,7,11,0]}});
let inputTensorImageData =
await ort.Tensor.fromImage(newImage, {format: 'RGBA', norm: {bias: [1, 10, 5, 0], mean: [5, 7, 11, 0]}});
// TODO: fix this
// creating tensor from image data should not depend on `options.format`.
// data url with type 'image/png' has a determined 'RGBA' format
compareTensors(inputTensorDataURL,inputTensorImageData,'BUG in ImageData & Data URL use case');
compareTensors(inputTensorDataURL, inputTensorImageData, 'BUG in ImageData & Data URL use case');
// Testing URL --> Tensor --> ImageData --> Tensor
let online = navigator.onLine;
if(online){
if (online) {
// URL element to tensor API
const inputTensorURL = await ort.Tensor.fromImage('https://media.istockphoto.com/id/172859087/photo/square-eggs.jpg?s=2048x2048&w=is&k=20&c=KiBRyyYaoUUSjcJLBh1-qqVu7LW6UQZBopZdva0f5e4=',{norm:{bias:[2,3,9,0],mean:[5,6,17,0]}});
const inputTensorURL = await ort.Tensor.fromImage(
'https://media.istockphoto.com/id/172859087/photo/square-eggs.jpg?s=2048x2048&w=is&k=20&c=KiBRyyYaoUUSjcJLBh1-qqVu7LW6UQZBopZdva0f5e4=',
{norm: {bias: [2, 3, 9, 0], mean: [5, 6, 17, 0]}});
// Tensor to ImageDAta API
let newImage = inputTensorURL.toImageData({format:'RGB',norm:{bias:[2/5,3/6,9/17,0],mean:[5,6,17,0]}});
let newImage =
inputTensorURL.toImageData({format: 'RGB', norm: {bias: [2 / 5, 3 / 6, 9 / 17, 0], mean: [5, 6, 17, 0]}});
// ImageData to tensor API
let inputTensorImageData = await ort.Tensor.fromImage(newImage,{format:'RGB',norm:{bias:[2,3,9,0],mean:[5,6,17,0]}});
let inputTensorImageData =
await ort.Tensor.fromImage(newImage, {format: 'RGB', norm: {bias: [2, 3, 9, 0], mean: [5, 6, 17, 0]}});
compareTensors(inputTensorURL,inputTensorImageData,'BUG in ImageData & URL');
}else{
console.log("No internet connection - didn't test Image URL to tensor API");
compareTensors(inputTensorURL, inputTensorImageData, 'BUG in ImageData & URL');
} else {
console.log('No internet connection - didn\'t test Image URL to tensor API');
}
});

View file

@ -3,7 +3,7 @@
'use strict';
it('Browser E2E testing - WebAssembly backend (multiple inference session create calls)', async function () {
it('Browser E2E testing - WebAssembly backend (multiple inference session create calls)', async function() {
const sessionPromiseA = createSession(ort);
const sessionPromiseB = createSession(ort);
await Promise.all([sessionPromiseA, sessionPromiseB]);

View file

@ -3,7 +3,7 @@
'use strict';
it('Browser E2E testing - WebAssembly backend (no threads)', async function () {
it('Browser E2E testing - WebAssembly backend (no threads)', async function() {
ort.env.wasm.numThreads = 1;
await testFunction(ort, { executionProviders: ['wasm'] });
await testFunction(ort, {executionProviders: ['wasm']});
});

View file

@ -3,15 +3,13 @@
'use strict';
it('Browser E2E testing - WebAssembly backend (path override filename)', async function () {
it('Browser E2E testing - WebAssembly backend (path override filename)', async function() {
// disable SIMD and multi-thread
ort.env.wasm.numThreads = 1;
ort.env.wasm.simd = false;
// override .wasm file path for 'ort-wasm.wasm'
ort.env.wasm.wasmPaths = {
'ort-wasm.wasm': new URL('./test-wasm-path-override/renamed.wasm', document.baseURI).href
};
ort.env.wasm.wasmPaths = {'ort-wasm.wasm': new URL('./test-wasm-path-override/renamed.wasm', document.baseURI).href};
await testFunction(ort, { executionProviders: ['wasm'] });
await testFunction(ort, {executionProviders: ['wasm']});
});

View file

@ -3,8 +3,7 @@
'use strict';
it('Browser E2E testing - WebAssembly backend (path override prefix)', async function () {
it('Browser E2E testing - WebAssembly backend (path override prefix)', async function() {
// disable SIMD and multi-thread
ort.env.wasm.numThreads = 1;
ort.env.wasm.simd = false;
@ -12,5 +11,5 @@ it('Browser E2E testing - WebAssembly backend (path override prefix)', async fun
// override .wasm file path prefix
ort.env.wasm.wasmPaths = new URL('./test-wasm-path-override/', document.baseURI).href;
await testFunction(ort, { executionProviders: ['wasm'] });
await testFunction(ort, {executionProviders: ['wasm']});
});

View file

@ -3,8 +3,8 @@
'use strict';
it('Browser E2E testing - WebAssembly backend (proxy, no threads)', async function () {
it('Browser E2E testing - WebAssembly backend (proxy, no threads)', async function() {
ort.env.wasm.numThreads = 1;
ort.env.wasm.proxy = true;
await testFunction(ort, { executionProviders: ['wasm'] });
await testFunction(ort, {executionProviders: ['wasm']});
});

View file

@ -3,7 +3,7 @@
'use strict';
it('Browser E2E testing - WebAssembly backend (proxy)', async function () {
it('Browser E2E testing - WebAssembly backend (proxy)', async function() {
ort.env.wasm.proxy = true;
await testFunction(ort, { executionProviders: ['wasm'] });
await testFunction(ort, {executionProviders: ['wasm']});
});

View file

@ -3,6 +3,6 @@
'use strict';
it('Browser E2E testing - WebAssembly backend', async function () {
await testFunction(ort, { executionProviders: ['wasm'] });
it('Browser E2E testing - WebAssembly backend', async function() {
await testFunction(ort, {executionProviders: ['wasm']});
});

View file

@ -3,6 +3,6 @@
'use strict';
it('Browser E2E testing - WebGL backend', async function () {
await testFunction(ort, { executionProviders: ['webgl'] });
it('Browser E2E testing - WebGL backend', async function() {
await testFunction(ort, {executionProviders: ['webgl']});
});

View file

@ -7,20 +7,19 @@ function assert(cond) {
if (!cond) throw new Error();
}
var createSession = function(ort, options) {
var createSession =
function(ort, options) {
return ort.InferenceSession.create('./model.onnx', options || {});
}
var testFunction = async function (ort, options) {
var testFunction = async function(ort, options) {
const session = await createSession(ort, options);
const dataA = Float32Array.from([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]);
const dataB = Float32Array.from([10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120]);
const fetches = await session.run({
a: new ort.Tensor('float32', dataA, [3, 4]),
b: new ort.Tensor('float32', dataB, [4, 3])
});
const fetches =
await session.run({a: new ort.Tensor('float32', dataA, [3, 4]), b: new ort.Tensor('float32', dataB, [4, 3])});
const c = fetches.c;

View file

@ -15,23 +15,23 @@ if (typeof USER_DATA !== 'string') {
throw new Error('flag --user-data=<CHROME_USER_DATA_FOLDER> is required');
}
module.exports = function (config) {
module.exports = function(config) {
const distPrefix = SELF_HOST ? './node_modules/onnxruntime-web/dist/' : 'http://localhost:8081/dist/';
config.set({
frameworks: ['mocha'],
files: [
{ pattern: distPrefix + ORT_MAIN },
{ pattern: './common.js' },
{ pattern: TEST_MAIN },
{ pattern: './node_modules/onnxruntime-web/dist/*.wasm', included: false, nocache: true },
{ pattern: './model.onnx', included: false }
{pattern: distPrefix + ORT_MAIN},
{pattern: './common.js'},
{pattern: TEST_MAIN},
{pattern: './node_modules/onnxruntime-web/dist/*.wasm', included: false, nocache: true},
{pattern: './model.onnx', included: false},
],
proxies: {
'/model.onnx': '/base/model.onnx',
'/test-wasm-path-override/ort-wasm.wasm': '/base/node_modules/onnxruntime-web/dist/ort-wasm.wasm',
'/test-wasm-path-override/renamed.wasm': '/base/node_modules/onnxruntime-web/dist/ort-wasm.wasm',
},
client: { captureConsole: true, mocha: { expose: ['body'], timeout: 60000 } },
client: {captureConsole: true, mocha: {expose: ['body'], timeout: 60000}},
reporters: ['mocha'],
captureTimeout: 120000,
reportSlowerThan: 100,
@ -42,10 +42,7 @@ module.exports = function (config) {
hostname: 'localhost',
browsers: [],
customLaunchers: {
Chrome_default: {
base: 'ChromeHeadless',
chromeDataDir: USER_DATA
},
Chrome_default: {base: 'ChromeHeadless', chromeDataDir: USER_DATA},
Chrome_no_threads: {
base: 'ChromeHeadless',
chromeDataDir: USER_DATA,

View file

@ -6,7 +6,7 @@
const ort = require('onnxruntime-web');
const testFunction = require('./common');
it('Node.js E2E testing - WebAssembly backend (no threads)', async function () {
it('Node.js E2E testing - WebAssembly backend (no threads)', async function() {
ort.env.wasm.numThreads = 1;
await testFunction(ort, { executionProviders: ['wasm'] });
await testFunction(ort, {executionProviders: ['wasm']});
});

View file

@ -6,8 +6,8 @@
const ort = require('onnxruntime-web');
const testFunction = require('./common');
it('Node.js E2E testing - WebAssembly backend', async function () {
await testFunction(ort, { executionProviders: ['wasm'] });
it('Node.js E2E testing - WebAssembly backend', async function() {
await testFunction(ort, {executionProviders: ['wasm']});
process.exit();
});

View file

@ -7,15 +7,13 @@ const path = require('path');
const ort = require('onnxruntime-web');
const testFunction = require('./common');
it('Node.js E2E testing - WebAssembly backend (path override filename)', async function () {
it('Node.js E2E testing - WebAssembly backend (path override filename)', async function() {
// disable SIMD and multi-thread
ort.env.wasm.numThreads = 1;
ort.env.wasm.simd = false;
// override .wasm file path for 'ort-wasm.wasm'
ort.env.wasm.wasmPaths = {
'ort-wasm.wasm': path.join(__dirname, 'test-wasm-path-override/renamed.wasm')
};
ort.env.wasm.wasmPaths = {'ort-wasm.wasm': path.join(__dirname, 'test-wasm-path-override/renamed.wasm')};
await testFunction(ort, { executionProviders: ['wasm'] });
await testFunction(ort, {executionProviders: ['wasm']});
});

View file

@ -7,7 +7,7 @@ const path = require('path');
const ort = require('onnxruntime-web');
const testFunction = require('./common');
it('Node.js E2E testing - WebAssembly backend (path override prefix)', async function () {
it('Node.js E2E testing - WebAssembly backend (path override prefix)', async function() {
// disable SIMD and multi-thread
ort.env.wasm.numThreads = 1;
ort.env.wasm.simd = false;
@ -15,5 +15,5 @@ it('Node.js E2E testing - WebAssembly backend (path override prefix)', async fun
// override .wasm file path prefix
ort.env.wasm.wasmPaths = path.join(__dirname, 'test-wasm-path-override/');
await testFunction(ort, { executionProviders: ['wasm'] });
await testFunction(ort, {executionProviders: ['wasm']});
});

View file

@ -5,7 +5,7 @@
const path = require('path');
const fs = require('fs-extra');
const { spawn } = require('child_process');
const {spawn} = require('child_process');
const startServer = require('./simple-http-server');
// copy whole folder to out-side of <ORT_ROOT>/js/ because we need to test in a folder that no `package.json` file
@ -32,12 +32,11 @@ function getNextUserDataDir() {
}
async function main() {
// find packed package
const {globbySync} = await import('globby');
const ORT_COMMON_FOLDER = path.resolve(JS_ROOT_FOLDER, 'common');
const ORT_COMMON_PACKED_FILEPATH_CANDIDATES = globbySync('onnxruntime-common-*.tgz', { cwd: ORT_COMMON_FOLDER });
const ORT_COMMON_PACKED_FILEPATH_CANDIDATES = globbySync('onnxruntime-common-*.tgz', {cwd: ORT_COMMON_FOLDER});
const PACKAGES_TO_INSTALL = [];
@ -48,7 +47,7 @@ async function main() {
}
const ORT_WEB_FOLDER = path.resolve(JS_ROOT_FOLDER, 'web');
const ORT_WEB_PACKED_FILEPATH_CANDIDATES = globbySync('onnxruntime-web-*.tgz', { cwd: ORT_WEB_FOLDER });
const ORT_WEB_PACKED_FILEPATH_CANDIDATES = globbySync('onnxruntime-web-*.tgz', {cwd: ORT_WEB_FOLDER});
if (ORT_WEB_PACKED_FILEPATH_CANDIDATES.length !== 1) {
throw new Error('cannot find exactly single package for onnxruntime-web.');
}
@ -69,11 +68,11 @@ async function main() {
await testAllNodejsCases();
// test cases with self-host (ort hosted in same origin)
await testAllBrowserCases({ hostInKarma: true });
await testAllBrowserCases({hostInKarma: true});
// test cases without self-host (ort hosted in same origin)
startServer(path.resolve(TEST_E2E_RUN_FOLDER, 'node_modules', 'onnxruntime-web'));
await testAllBrowserCases({ hostInKarma: false });
await testAllBrowserCases({hostInKarma: false});
// no error occurs, exit with code 0
process.exit(0);
@ -101,27 +100,27 @@ async function testAllNodejsCases() {
await runInShell('node ./node_modules/mocha/bin/mocha ./node-test-wasm-path-override-prefix.js');
}
async function testAllBrowserCases({ hostInKarma }) {
await runKarma({ hostInKarma, main: './browser-test-webgl.js'});
await runKarma({ hostInKarma, main: './browser-test-webgl.js', ortMain: 'ort.webgl.min.js'});
await runKarma({ hostInKarma, main: './browser-test-wasm.js'});
await runKarma({ hostInKarma, main: './browser-test-wasm.js', ortMain: 'ort.wasm.min.js'});
await runKarma({ hostInKarma, main: './browser-test-wasm-multi-session-create.js'});
await runKarma({ hostInKarma, main: './browser-test-wasm-no-threads.js'});
await runKarma({ hostInKarma, main: './browser-test-wasm-no-threads.js', ortMain: 'ort.wasm-core.min.js'});
await runKarma({ hostInKarma, main: './browser-test-wasm-proxy.js'});
await runKarma({ hostInKarma, main: './browser-test-wasm-proxy-no-threads.js'});
await runKarma({ hostInKarma, main: './browser-test-wasm-path-override-filename.js'});
await runKarma({ hostInKarma, main: './browser-test-wasm-path-override-filename.js', ortMain: 'ort.wasm.min.js'});
await runKarma({ hostInKarma, main: './browser-test-wasm-path-override-prefix.js'});
await runKarma({ hostInKarma, main: './browser-test-wasm-path-override-prefix.js', ortMain: 'ort.wasm.min.js'});
await runKarma({ hostInKarma, main: './browser-test-wasm-image-tensor-image.js'});
async function testAllBrowserCases({hostInKarma}) {
await runKarma({hostInKarma, main: './browser-test-webgl.js'});
await runKarma({hostInKarma, main: './browser-test-webgl.js', ortMain: 'ort.webgl.min.js'});
await runKarma({hostInKarma, main: './browser-test-wasm.js'});
await runKarma({hostInKarma, main: './browser-test-wasm.js', ortMain: 'ort.wasm.min.js'});
await runKarma({hostInKarma, main: './browser-test-wasm-multi-session-create.js'});
await runKarma({hostInKarma, main: './browser-test-wasm-no-threads.js'});
await runKarma({hostInKarma, main: './browser-test-wasm-no-threads.js', ortMain: 'ort.wasm-core.min.js'});
await runKarma({hostInKarma, main: './browser-test-wasm-proxy.js'});
await runKarma({hostInKarma, main: './browser-test-wasm-proxy-no-threads.js'});
await runKarma({hostInKarma, main: './browser-test-wasm-path-override-filename.js'});
await runKarma({hostInKarma, main: './browser-test-wasm-path-override-filename.js', ortMain: 'ort.wasm.min.js'});
await runKarma({hostInKarma, main: './browser-test-wasm-path-override-prefix.js'});
await runKarma({hostInKarma, main: './browser-test-wasm-path-override-prefix.js', ortMain: 'ort.wasm.min.js'});
await runKarma({hostInKarma, main: './browser-test-wasm-image-tensor-image.js'});
}
async function runKarma({ hostInKarma, main, browser = 'Chrome_default', ortMain = 'ort.min.js' }) {
async function runKarma({hostInKarma, main, browser = 'Chrome_default', ortMain = 'ort.min.js'}) {
const selfHostFlag = hostInKarma ? '--self-host' : '';
await runInShell(
`npx karma start --single-run --browsers ${browser} ${selfHostFlag} --ort-main=${ortMain} --test-main=${main} --user-data=${getNextUserDataDir()}`);
await runInShell(`npx karma start --single-run --browsers ${browser} ${selfHostFlag} --ort-main=${
ortMain} --test-main=${main} --user-data=${getNextUserDataDir()}`);
}
async function runInShell(cmd) {
@ -130,8 +129,8 @@ async function runInShell(cmd) {
console.log(' > ' + cmd);
console.log('===============================================================');
let complete = false;
const childProcess = spawn(cmd, { shell: true, stdio: 'inherit', cwd: TEST_E2E_RUN_FOLDER });
childProcess.on('close', function (code) {
const childProcess = spawn(cmd, {shell: true, stdio: 'inherit', cwd: TEST_E2E_RUN_FOLDER});
childProcess.on('close', function(code) {
if (code !== 0) {
process.exit(code);
} else {
@ -144,8 +143,8 @@ async function runInShell(cmd) {
}
async function delay(ms) {
return new Promise(function (resolve) {
setTimeout(function () {
return new Promise(function(resolve) {
setTimeout(function() {
resolve();
}, ms);
});

View file

@ -29,35 +29,33 @@ const validRequests = {
'/dist/ort.wasm-core.min.js': ['dist/ort.wasm-core.min.js', 'text/javascript'],
};
module.exports = function (dir) {
http.createServer(function (request, response) {
console.log('request ', request.url);
module.exports = function(dir) {
http.createServer(function(request, response) {
console.log(`request ${request.url.replace(/\n|\r/g, '')}`);
const requestData = validRequests[request.url];
if (!request) {
response.writeHead(404);
response.end('404');
} else {
const [filePath, contentType] = requestData;
fs.readFile(path.resolve(dir, filePath), function (error, content) {
if (error) {
if (error.code == 'ENOENT') {
response.writeHead(404);
response.end('404');
}
else {
response.writeHead(500);
response.end('500');
}
const requestData = validRequests[request.url];
if (!request) {
response.writeHead(404);
response.end('404');
} else {
const [filePath, contentType] = requestData;
fs.readFile(path.resolve(dir, filePath), function(error, content) {
if (error) {
if (error.code == 'ENOENT') {
response.writeHead(404);
response.end('404');
} else {
response.writeHead(500);
response.end('500');
}
} else {
response.setHeader('access-control-allow-origin', '*');
response.writeHead(200, {'Content-Type': contentType});
response.end(content, 'utf-8');
}
});
}
else {
response.setHeader('access-control-allow-origin', '*');
response.writeHead(200, { 'Content-Type': contentType });
response.end(content, 'utf-8');
}
});
}
}).listen(8081);
})
.listen(8081);
console.log('Server running at http://127.0.0.1:8081/');
};

View file

@ -7,12 +7,12 @@ const path = require('path');
const webpack = require('webpack');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin');
const TerserPlugin = require("terser-webpack-plugin");
const TerserPlugin = require('terser-webpack-plugin');
const minimist = require('minimist');
// commandline args
const args = minimist(process.argv);
const bundleMode = args['bundle-mode'] || 'prod'; // 'prod'|'dev'|'perf'|'node'|undefined;
const bundleMode = args['bundle-mode'] || 'prod'; // 'prod'|'dev'|'perf'|'node'|undefined;
const useAnalyzer = !!args.a || !!args['use-analyzer']; // -a, --use-analyzer
const filter = args.f || args.filter;
@ -45,12 +45,8 @@ function defaultTerserPluginOptions(target) {
format: {
comments: false,
},
compress: {
passes: 2
},
mangle: {
reserved: ["_scriptDir", "startWorker"]
}
compress: {passes: 2},
mangle: {reserved: ['_scriptDir', 'startWorker']}
}
};
}
@ -64,51 +60,34 @@ const DEFAULT_BUILD_DEFS = {
};
// common config for release bundle
function buildConfig({ filename, format, target, mode, devtool, build_defs }) {
function buildConfig({filename, format, target, mode, devtool, build_defs}) {
const config = {
target: [format === 'commonjs' ? 'node' : 'web', target],
entry: path.resolve(__dirname, 'lib/index.ts'),
output: {
path: path.resolve(__dirname, 'dist'),
filename,
library: {
type: format
}
},
output: {path: path.resolve(__dirname, 'dist'), filename, library: {type: format}},
resolve: {
extensions: ['.ts', '.js'],
alias: {
"util": false,
'util': false,
},
fallback: {
"crypto": false,
"fs": false,
"path": false,
"util": false,
"os": false,
"worker_threads": false,
"perf_hooks": false,
'crypto': false,
'fs': false,
'path': false,
'util': false,
'os': false,
'worker_threads': false,
'perf_hooks': false,
}
},
plugins: [
new webpack.DefinePlugin({ BUILD_DEFS: build_defs }),
new webpack.WatchIgnorePlugin({ paths: [/\.js$/, /\.d\.ts$/] })
new webpack.DefinePlugin({BUILD_DEFS: build_defs}), new webpack.WatchIgnorePlugin({paths: [/\.js$/, /\.d\.ts$/]})
],
module: {
rules: [{
test: /\.ts$/,
use: [
{
loader: 'ts-loader',
options: {
compilerOptions: { target }
}
}
]
}, {
test: /ort-wasm.*\.worker\.js$/,
type: 'asset/source'
}]
rules: [
{test: /\.ts$/, use: [{loader: 'ts-loader', options: {compilerOptions: {target}}}]},
{test: /ort-wasm.*\.worker\.js$/, type: 'asset/source'}
]
},
mode,
node: false,
@ -116,10 +95,8 @@ function buildConfig({ filename, format, target, mode, devtool, build_defs }) {
};
if (useAnalyzer) {
config.plugins.unshift(new BundleAnalyzerPlugin({
analyzerMode: 'static',
reportFilename: `${filename}.report.html`
}));
config.plugins.unshift(
new BundleAnalyzerPlugin({analyzerMode: 'static', reportFilename: `${filename}.report.html`}));
}
if (mode === 'production') {
@ -134,45 +111,36 @@ function buildConfig({ filename, format, target, mode, devtool, build_defs }) {
// add a custom plugin to check whether code contains 'BUILD_DEFS'
config.plugins.push({
apply: (compiler) => {
compiler.hooks.afterCompile.tap(
'Check BUILD_DEFS',
(compilation) => {
for (const filename of compilation.assetsInfo.keys()) {
if (filename.endsWith('.js')) {
const asset = compilation.assets[filename];
if (asset) {
const content = asset.source();
if (typeof content !== 'string') {
throw new Error(`content for target file '${filename}' is not string.`);
}
if (content.includes('DISABLE_WEBGL')
|| content.includes('DISABLE_WASM')
|| content.includes('DISABLE_WASM_PROXY')
|| content.includes('DISABLE_WASM_THREAD')) {
throw new Error(`target file '${filename}' contains data fields from "BUILD_DEFS".`);
}
compiler.hooks.afterCompile.tap('Check BUILD_DEFS', (compilation) => {
for (const filename of compilation.assetsInfo.keys()) {
if (filename.endsWith('.js')) {
const asset = compilation.assets[filename];
if (asset) {
const content = asset.source();
if (typeof content !== 'string') {
throw new Error(`content for target file '${filename}' is not string.`);
}
if (content.includes('DISABLE_WEBGL') || content.includes('DISABLE_WASM') ||
content.includes('DISABLE_WASM_PROXY') || content.includes('DISABLE_WASM_THREAD')) {
throw new Error(`target file '${filename}' contains data fields from "BUILD_DEFS".`);
}
}
}
});
}
});
}
});
} else {
config.plugins.push(new webpack.BannerPlugin({ banner: COPYRIGHT_BANNER, raw: true }));
config.plugins.push(new webpack.BannerPlugin({banner: COPYRIGHT_BANNER, raw: true}));
}
return config;
}
// "ort{.min}.js" config
function buildOrtConfig({
suffix = '',
target = 'es2017',
mode = 'production',
devtool = 'source-map',
build_defs = DEFAULT_BUILD_DEFS
}) {
const config = buildConfig({ filename: `ort${suffix}.js`, format: 'umd', target, mode, devtool, build_defs });
function buildOrtConfig(
{suffix = '', target = 'es2017', mode = 'production', devtool = 'source-map', build_defs = DEFAULT_BUILD_DEFS}) {
const config = buildConfig({filename: `ort${suffix}.js`, format: 'umd', target, mode, devtool, build_defs});
// set global name 'ort'
config.output.library.name = 'ort';
return config;
@ -187,14 +155,10 @@ function buildOrtWebConfig({
devtool = 'source-map',
build_defs = DEFAULT_BUILD_DEFS
}) {
const config = buildConfig({ filename: `ort-web${suffix}.js`, format, target, mode, devtool, build_defs });
const config = buildConfig({filename: `ort-web${suffix}.js`, format, target, mode, devtool, build_defs});
// exclude onnxruntime-common from bundle
config.externals = {
'onnxruntime-common': {
commonjs: "onnxruntime-common",
commonjs2: "onnxruntime-common",
root: 'ort'
}
'onnxruntime-common': {commonjs: 'onnxruntime-common', commonjs2: 'onnxruntime-common', root: 'ort'}
};
// in nodejs, treat as external dependencies
if (format === 'commonjs') {
@ -222,9 +186,7 @@ function buildTestRunnerConfig({
output: {
path: path.resolve(__dirname, 'test'),
filename: `ort${suffix}.js`,
library: {
type: format
},
library: {type: format},
devtoolNamespace: '',
},
externals: {
@ -247,27 +209,15 @@ function buildTestRunnerConfig({
}
},
plugins: [
new webpack.DefinePlugin({ BUILD_DEFS: build_defs }),
new webpack.WatchIgnorePlugin({ paths: [/\.js$/, /\.d\.ts$/] }),
new NodePolyfillPlugin({
excludeAliases: ["console", "Buffer"]
}),
new webpack.DefinePlugin({BUILD_DEFS: build_defs}),
new webpack.WatchIgnorePlugin({paths: [/\.js$/, /\.d\.ts$/]}),
new NodePolyfillPlugin({excludeAliases: ['console', 'Buffer']}),
],
module: {
rules: [{
test: /\.ts$/,
use: [
{
loader: 'ts-loader',
options: {
compilerOptions: { target }
}
}
]
}, {
test: /ort-wasm.*\.worker\.js$/,
type: 'asset/source'
}]
rules: [
{test: /\.ts$/, use: [{loader: 'ts-loader', options: {compilerOptions: {target}}}]},
{test: /ort-wasm.*\.worker\.js$/, type: 'asset/source'}
]
},
mode,
node: false,
@ -287,65 +237,72 @@ module.exports = () => {
switch (bundleMode) {
case 'prod':
builds.push(
// ort.min.js
buildOrtConfig({ suffix: '.min' }),
// ort.js
buildOrtConfig({ mode: 'development', devtool: 'inline-source-map' }),
// ort.es6.min.js
buildOrtConfig({ suffix: '.es6.min', target: 'es6' }),
// ort.es5.min.js
buildOrtConfig({ suffix: '.es5.min', target: 'es5' }),
// ort.min.js
buildOrtConfig({suffix: '.min'}),
// ort.js
buildOrtConfig({mode: 'development', devtool: 'inline-source-map'}),
// ort.es6.min.js
buildOrtConfig({suffix: '.es6.min', target: 'es6'}),
// ort.es5.min.js
buildOrtConfig({suffix: '.es5.min', target: 'es5'}),
// ort.wasm.min.js
buildOrtConfig({
suffix: '.wasm.min', build_defs: {
...DEFAULT_BUILD_DEFS,
DISABLE_WEBGL: true,
}
}),
// ort.webgl.min.js
buildOrtConfig({
suffix: '.webgl.min', build_defs: {
...DEFAULT_BUILD_DEFS,
DISABLE_WASM: true,
}
}),
// ort.wasm-core.min.js
buildOrtConfig({
suffix: '.wasm-core.min', build_defs: {
...DEFAULT_BUILD_DEFS,
DISABLE_WEBGL: true,
DISABLE_WASM_PROXY: true,
DISABLE_WASM_THREAD: true,
}
}),
// ort.webgpu.min.js
buildOrtConfig({
suffix: '.webgpu.min', build_defs: {
...DEFAULT_BUILD_DEFS,
DISABLE_WEBGPU: false,
}
}),
// ort.wasm.min.js
buildOrtConfig({
suffix: '.wasm.min',
build_defs: {
...DEFAULT_BUILD_DEFS,
DISABLE_WEBGL: true,
}
}),
// ort.webgl.min.js
buildOrtConfig({
suffix: '.webgl.min',
build_defs: {
...DEFAULT_BUILD_DEFS,
DISABLE_WASM: true,
}
}),
// ort.wasm-core.min.js
buildOrtConfig({
suffix: '.wasm-core.min',
build_defs: {
...DEFAULT_BUILD_DEFS,
DISABLE_WEBGL: true,
DISABLE_WASM_PROXY: true,
DISABLE_WASM_THREAD: true,
}
}),
// ort.webgpu.min.js
buildOrtConfig({
suffix: '.webgpu.min',
build_defs: {
...DEFAULT_BUILD_DEFS,
DISABLE_WEBGPU: false,
}
}),
// ort-web.min.js
buildOrtWebConfig({ suffix: '.min' }),
// ort-web.js
buildOrtWebConfig({ mode: 'development', devtool: 'inline-source-map' }),
// ort-web.es6.min.js
buildOrtWebConfig({ suffix: '.es6.min', target: 'es6' }),
// ort-web.es5.min.js
buildOrtWebConfig({ suffix: '.es5.min', target: 'es5' }),
// ort-web.min.js
buildOrtWebConfig({suffix: '.min'}),
// ort-web.js
buildOrtWebConfig({mode: 'development', devtool: 'inline-source-map'}),
// ort-web.es6.min.js
buildOrtWebConfig({suffix: '.es6.min', target: 'es6'}),
// ort-web.es5.min.js
buildOrtWebConfig({suffix: '.es5.min', target: 'es5'}),
);
case 'node':
builds.push(
// ort-web.node.js
buildOrtWebConfig({ suffix: '.node', format: 'commonjs' }),
// ort-web.node.js
buildOrtWebConfig({suffix: '.node', format: 'commonjs'}),
);
break;
case 'dev':
builds.push(buildTestRunnerConfig({
suffix: '.dev', mode: 'development', devtool: 'inline-source-map', build_defs: {
suffix: '.dev',
mode: 'development',
devtool: 'inline-source-map',
build_defs: {
...DEFAULT_BUILD_DEFS,
DISABLE_WEBGPU: false,
}
@ -353,7 +310,8 @@ module.exports = () => {
break;
case 'perf':
builds.push(buildTestRunnerConfig({
suffix: '.perf', build_defs: {
suffix: '.perf',
build_defs: {
...DEFAULT_BUILD_DEFS,
DISABLE_WEBGPU: false,
}