onnxruntime/js/common/lib
Yulong Wang 59f42cccb8
[js/common] refactor tensor type in onnxruntime-common (#15843)
### Description
<!-- Describe your changes. -->

refactor tensor type in onnxruntime-common.

### Motivation and Context
There major motivation is that I am doing a local change to address the
API part of #15312. And I am doing a refactoring of onnxruntime-common
anyway (#15772).

The `tensor.ts` and `tensor-impl.ts` are too large, so I split contents
into multiple files to make the type declarations clearer.

The original target of this change is for API only ( ie. do not refactor
any implementation.). However, there are a few type/implementation
inconsistencies so I also made minimal changes to fix them.

### Changes
- extract `TensorUtils` for non-template interfaces
- extract `TensorFactory` for all overloads of `Tensor.fromImage()`
- refactor options type that used for `Tensor.fromImage()`
- fix JSDoc comments to make option descriptions consistent with actual
type declarations
- fix an inconsistency for `options.format` and `options.bitmapFormat`;
change all `bitmapFormat` to `format`
- extract `ConversionUtils` for `tensor.toDataURL()` and
`tensor.toImageData()`
- put implementations into multiple files from `tensor-impl.ts`
- fix a bug that cause unittest fail. put comments for future fix.
2023-06-09 16:19:29 -07:00
..
backend-impl.ts [js/web] add 'xnnpack' to EP list (#12723) 2022-10-03 10:38:45 -07:00
backend.ts
env-impl.ts [js] add API that allows to get package version (#16207) 2023-06-09 16:18:53 -07:00
env.ts [js] add API that allows to get package version (#16207) 2023-06-09 16:18:53 -07:00
index.ts
inference-session-impl.ts [js] allow manually release inference session (#16169) 2023-05-31 00:31:38 -07:00
inference-session.ts [js] allow manually release inference session (#16169) 2023-05-31 00:31:38 -07:00
onnx-value.ts
tensor-conversion-impl.ts [js/common] refactor tensor type in onnxruntime-common (#15843) 2023-06-09 16:19:29 -07:00
tensor-conversion.ts [js/common] refactor tensor type in onnxruntime-common (#15843) 2023-06-09 16:19:29 -07:00
tensor-factory-impl.ts [js/common] refactor tensor type in onnxruntime-common (#15843) 2023-06-09 16:19:29 -07:00
tensor-factory.ts [js/common] refactor tensor type in onnxruntime-common (#15843) 2023-06-09 16:19:29 -07:00
tensor-impl.ts [js/common] refactor tensor type in onnxruntime-common (#15843) 2023-06-09 16:19:29 -07:00
tensor-utils-impl.ts [js/common] refactor tensor type in onnxruntime-common (#15843) 2023-06-09 16:19:29 -07:00
tensor-utils.ts [js/common] refactor tensor type in onnxruntime-common (#15843) 2023-06-09 16:19:29 -07:00
tensor.ts [js/common] refactor tensor type in onnxruntime-common (#15843) 2023-06-09 16:19:29 -07:00
version.ts [js] add API that allows to get package version (#16207) 2023-06-09 16:18:53 -07:00