onnxruntime
onnxruntime copied to clipboard
[Web] Allow passing Uint8ClampedArray to ort.Tensor()
Describe the issue
ort.Tensor() does not accecpt Uint8ClampedArray and will result with an error. One must explicitly covert to Uint8Array as in new ort.Tensor(Uint8Array.from(clamped)). This defied my expectation to be able to use either.
To reproduce
new ort.Tensor(new Uint8ClampedArray(1))
Urgency
not urgent
ONNX Runtime Installation
Released Package
ONNX Runtime Version or Commit ID
https://cdn.jsdelivr.net/npm/[email protected]/dist/esm/ort.webgpu.min.js
Execution Provider
'webgpu' (WebGPU)
@prathikr could you help to take a look?
The feature is merged in main branch and it's expected to be available in the next dev build or 1.20 release.