[WebNN EP] Fixed bug in op checking (#18638)

This commit is contained in:
Wanming Lin 2023-12-01 09:47:56 +08:00 committed by GitHub
parent 73d9b03509
commit c7732a78d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -229,7 +229,7 @@ inline bool CheckSingleOp(const std::string& op_type, const emscripten::val& wnn
// fall back early to the ORT CPU EP rather than fail in the WebNN "cpu" deviceType.
// This is a workaround because the op may be included in MLGraphBuilder for DirectML
// backend but without XNNPack implementation in Chromium.
if (!op_map.find(op_type)->second.isCpuSupported) {
if (!op_map.find(op_type)->second.isCpuSupported && device_type == WebnnDeviceType::CPU) {
return false;
}