onnxruntime icon indicating copy to clipboard operation
onnxruntime copied to clipboard

[Web] Allow passing Uint8ClampedArray to ort.Tensor()

Open eyaler opened this issue 1 year ago • 1 comments

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)

eyaler avatar Aug 15 '24 12:08 eyaler

@prathikr could you help to take a look?

fs-eire avatar Aug 29 '24 09:08 fs-eire

The feature is merged in main branch and it's expected to be available in the next dev build or 1.20 release.

fs-eire avatar Sep 12 '24 07:09 fs-eire