From c7732a78d7e815de489fed22cfee610a445b9ca2 Mon Sep 17 00:00:00 2001 From: Wanming Lin Date: Fri, 1 Dec 2023 09:47:56 +0800 Subject: [PATCH] [WebNN EP] Fixed bug in op checking (#18638) --- onnxruntime/core/providers/webnn/builders/helper.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onnxruntime/core/providers/webnn/builders/helper.h b/onnxruntime/core/providers/webnn/builders/helper.h index 617108c57d..68f009a94e 100644 --- a/onnxruntime/core/providers/webnn/builders/helper.h +++ b/onnxruntime/core/providers/webnn/builders/helper.h @@ -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; }