microsoft / onnxruntime

ONNX Runtime: cross-platform, high performance ML inferencing and training accelerator
https://onnxruntime.ai
MIT License
14.41k stars 2.89k forks source link

[Web] Rename WebNN EP MLOperandDescriptor's "dimensions" key to "shape" #22120

Closed huningxin closed 3 weeks ago

huningxin commented 3 weeks ago

Describe the issue

Align with spec and Chromium implementation change:

https://chromium-review.googlesource.com/c/chromium/src/+/5502631

https://github.com/webmachinelearning/webnn/pull/676

/cc @Honry @fdwr

To reproduce

See the spec PR

Urgency

No response

ONNX Runtime Installation

Built from Source

ONNX Runtime Version or Commit ID

Latest

Execution Provider

WebNN EP

fdwr commented 3 weeks ago

For now we can declare MLOperandDescs with both fields (shape is an alias of dimensions), so that we have some transitional overlap across Chromium versions without worrying about exactly matching. e.g.:

const someOperandDesc = {
    dataType: "float32",
    dimensions: listOfDimensions
    shape: listOfDimensions
}