webmachinelearning / webnn

🧠 Web Neural Network API
https://www.w3.org/TR/webnn/
Other
397 stars 48 forks source link

Missing TypeScript Type Declaration #677

Closed egalli closed 4 months ago

egalli commented 7 months ago

In order to be able to use WebNN from TypeScript, WebNN needs a .d.ts type declaration file.

WebGPU uses a set scripts and manual changes under https://github.com/gpuweb/types/. This repository gets published under @webgpu/types.

I propose that we create a similar repository for WebNN. I have created a starting point on https://github.com/egalli/webnn-types-example/ that WebNN could adopt under the webmachinelearning org. The webnn-types-example project is based on the WebGPU repository plus a few changes to make it compatible with newer versions of TypeScript and some oddities in the tsc compiler.

anssiko commented 6 months ago

@egalli, thanks for this proposal, looks very useful and relevant. I will bring this to our upcoming meeting for discussion.

I assume you'd be willing to contribute your starting point to the group. The likely home would be the WebML CG that is chartered to take on this type of work. I also assume you'd be in a position to join the WebML CG that makes this type of contribution possible. I also assume you'd be interested in continuing to maintain this project, but are looking for interested community participants to help you. Let us know if any of these assumptions are not correct.

egalli commented 6 months ago

Sounds good to me.

bbernhar commented 6 months ago

FYI, this issue was encountered upon enabling MLBuffer in a WebNN EP.

inexorabletash commented 4 months ago

https://github.com/webmachinelearning/webnn-types was created - empty so far!

@egalli if you've joined the CG, can you submit a PR against that repo to pull in your repo as a starting point?

Then maybe we can close this and just iterate on that repo?

egalli commented 4 months ago

I'm OK with closing this issue.

As for a PR, sorry to the delay, I'm going through an internal approval process at my company. This is required before I can officially upload the code.

egalli commented 4 months ago

Closing issue