onnxruntime/js/web/lib/wasm
Yulong Wang 58f4921686
[js] changes to allow Float16Array if any polyfill is available (#19305)
### Description

This change adds only necessary code to enable ort-web works with any
Float16Array polyfill. Unlike #19302, in this PR, ort-web does not
include any specific polyfill; instead, it's user's choice for how to
use a polyfill.

ORT-web uses Float16Array if it's available; otherwise, fallback to use
Uint16Array.

```js
// case 1: user does not use polyfill:
import * as ort from 'onnxruntime-web';

const myF16Data = new Uint16Array(...);  // need to use Uint16Array
const myF16tensor = new ort.Tensor('float16', myF16Data, dims);
```

```js
// case 2: user use polyfill:
import * as ort from 'onnxruntime-web';
import {
  Float16Array, isFloat16Array, isTypedArray,
  getFloat16, setFloat16,
  f16round,
} from "@petamoriken/float16";
globalThis.Float16Array = Float16Array;  // ort-web will pick the global Float16Array

const myF16Data = new Float16Array(...);  // Use the polyfilled Float16Array type
const myF16tensor = new ort.Tensor('float16', myF16Data, dims);
```
2024-02-21 00:31:06 -08:00
..
binding [js/webgpu] Support capture and replay for jsep (#18989) 2024-01-30 18:28:03 -08:00
jsep [js] small fix to workaround formatter (#19400) 2024-02-20 17:23:01 -08:00
proxy-worker [js] enable external data loading for ort-web (#19087) 2024-01-12 19:24:24 -08:00
proxy-messages.ts [js/web] revise backend registration (#18715) 2023-12-20 14:45:55 -08:00
proxy-wrapper.ts [js/web] revise backend registration (#18715) 2023-12-20 14:45:55 -08:00
run-options.ts [js/web] enable ONNX Runtime Web error messages in JS (#16335) 2023-06-15 09:45:41 -07:00
session-handler-inference.ts [js] enable external data loading for ort-web (#19087) 2024-01-12 19:24:24 -08:00
session-handler-training.ts [js/web] revise backend registration (#18715) 2023-12-20 14:45:55 -08:00
session-options.ts [js/webgpu] Support capture and replay for jsep (#18989) 2024-01-30 18:28:03 -08:00
wasm-common.ts [js] changes to allow Float16Array if any polyfill is available (#19305) 2024-02-21 00:31:06 -08:00
wasm-core-impl.ts [js/webgpu] Support capture and replay for jsep (#18989) 2024-01-30 18:28:03 -08:00
wasm-factory.ts [js/web] show warning when numThreads is set but threads is not supported (#19179) 2024-01-17 15:04:22 -08:00
wasm-training-core-impl.ts [js/web] revise backend registration (#18715) 2023-12-20 14:45:55 -08:00
wasm-utils-load-file.ts [js/web] allow proxy to load model with 1GB <= size < 2GB (#19178) 2024-01-17 15:03:43 -08:00
wasm-utils.ts [js/web] enable ONNX Runtime Web error messages in JS (#16335) 2023-06-15 09:45:41 -07:00