Skip to content

Commit 798cea2

Browse files
authored
[WebNN EP] Remove legacy MLOperandDescriptor.type (#20783)
Latest Chrome has supported MLOperandDescriptor.dataType, remove legacy MLOperandDescriptor.type.
1 parent 9ea9f9e commit 798cea2

File tree

1 file changed

+0
-11
lines changed
  • onnxruntime/core/providers/webnn/builders

1 file changed

+0
-11
lines changed

onnxruntime/core/providers/webnn/builders/helper.cc

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -155,41 +155,30 @@ bool IsValidMultidirectionalBroadcast(std::vector<int64_t>& shape_a,
155155
}
156156

157157
bool SetWebnnDataType(emscripten::val& desc, const int32_t data_type) {
158-
// WebNN changed the name of the MLOperandDescriptor's data type from "type" to "dataType",
159-
// use a duplicate entry temporarily to workaround this API breaking issue.
160-
// TODO: Remove legacy "type" once all browsers implement the new "dataType".
161158
switch (data_type) {
162159
case ONNX_NAMESPACE::TensorProto_DataType_BOOL:
163160
case ONNX_NAMESPACE::TensorProto_DataType_UINT8:
164-
desc.set("type", emscripten::val("uint8"));
165161
desc.set("dataType", emscripten::val("uint8"));
166162
return true;
167163
case ONNX_NAMESPACE::TensorProto_DataType_INT8:
168-
desc.set("type", emscripten::val("int8"));
169164
desc.set("dataType", emscripten::val("int8"));
170165
return true;
171166
case ONNX_NAMESPACE::TensorProto_DataType_FLOAT16:
172-
desc.set("type", emscripten::val("float16"));
173167
desc.set("dataType", emscripten::val("float16"));
174168
return true;
175169
case ONNX_NAMESPACE::TensorProto_DataType_FLOAT:
176-
desc.set("type", emscripten::val("float32"));
177170
desc.set("dataType", emscripten::val("float32"));
178171
return true;
179172
case ONNX_NAMESPACE::TensorProto_DataType_INT32:
180-
desc.set("type", emscripten::val("int32"));
181173
desc.set("dataType", emscripten::val("int32"));
182174
return true;
183175
case ONNX_NAMESPACE::TensorProto_DataType_INT64:
184-
desc.set("type", emscripten::val("int64"));
185176
desc.set("dataType", emscripten::val("int64"));
186177
return true;
187178
case ONNX_NAMESPACE::TensorProto_DataType_UINT32:
188-
desc.set("type", emscripten::val("uint32"));
189179
desc.set("dataType", emscripten::val("uint32"));
190180
return true;
191181
case ONNX_NAMESPACE::TensorProto_DataType_UINT64:
192-
desc.set("type", emscripten::val("uint64"));
193182
desc.set("dataType", emscripten::val("uint64"));
194183
return true;
195184
default:

0 commit comments

Comments
 (0)