mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-29 23:06:41 +00:00
[WebNN EP] Remove legacy MLOperandDescriptor.type (#20783)
Latest Chrome has supported MLOperandDescriptor.dataType, remove legacy MLOperandDescriptor.type.
This commit is contained in:
parent
9ea9f9e46a
commit
798cea2350
1 changed files with 0 additions and 11 deletions
|
|
@ -155,41 +155,30 @@ bool IsValidMultidirectionalBroadcast(std::vector<int64_t>& shape_a,
|
|||
}
|
||||
|
||||
bool SetWebnnDataType(emscripten::val& desc, const int32_t data_type) {
|
||||
// WebNN changed the name of the MLOperandDescriptor's data type from "type" to "dataType",
|
||||
// use a duplicate entry temporarily to workaround this API breaking issue.
|
||||
// TODO: Remove legacy "type" once all browsers implement the new "dataType".
|
||||
switch (data_type) {
|
||||
case ONNX_NAMESPACE::TensorProto_DataType_BOOL:
|
||||
case ONNX_NAMESPACE::TensorProto_DataType_UINT8:
|
||||
desc.set("type", emscripten::val("uint8"));
|
||||
desc.set("dataType", emscripten::val("uint8"));
|
||||
return true;
|
||||
case ONNX_NAMESPACE::TensorProto_DataType_INT8:
|
||||
desc.set("type", emscripten::val("int8"));
|
||||
desc.set("dataType", emscripten::val("int8"));
|
||||
return true;
|
||||
case ONNX_NAMESPACE::TensorProto_DataType_FLOAT16:
|
||||
desc.set("type", emscripten::val("float16"));
|
||||
desc.set("dataType", emscripten::val("float16"));
|
||||
return true;
|
||||
case ONNX_NAMESPACE::TensorProto_DataType_FLOAT:
|
||||
desc.set("type", emscripten::val("float32"));
|
||||
desc.set("dataType", emscripten::val("float32"));
|
||||
return true;
|
||||
case ONNX_NAMESPACE::TensorProto_DataType_INT32:
|
||||
desc.set("type", emscripten::val("int32"));
|
||||
desc.set("dataType", emscripten::val("int32"));
|
||||
return true;
|
||||
case ONNX_NAMESPACE::TensorProto_DataType_INT64:
|
||||
desc.set("type", emscripten::val("int64"));
|
||||
desc.set("dataType", emscripten::val("int64"));
|
||||
return true;
|
||||
case ONNX_NAMESPACE::TensorProto_DataType_UINT32:
|
||||
desc.set("type", emscripten::val("uint32"));
|
||||
desc.set("dataType", emscripten::val("uint32"));
|
||||
return true;
|
||||
case ONNX_NAMESPACE::TensorProto_DataType_UINT64:
|
||||
desc.set("type", emscripten::val("uint64"));
|
||||
desc.set("dataType", emscripten::val("uint64"));
|
||||
return true;
|
||||
default:
|
||||
|
|
|
|||
Loading…
Reference in a new issue