From 409170bf2f07145277000b588ddc94f8978c1bfb Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Thu, 5 Oct 2023 22:58:28 +0000 Subject: [PATCH] update --- .../core/providers/js/js_execution_provider.cc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/onnxruntime/core/providers/js/js_execution_provider.cc b/onnxruntime/core/providers/js/js_execution_provider.cc index 6ee2d88465537..7ad742cae373f 100644 --- a/onnxruntime/core/providers/js/js_execution_provider.cc +++ b/onnxruntime/core/providers/js/js_execution_provider.cc @@ -649,6 +649,10 @@ std::vector> JsExecutionProvider::GetCapabili const auto& node = *p_node; if (!node.GetExecutionProviderType().empty()) { + // If the node was added by layout transformer, do not move it to CPU + if(node.GetExecutionProviderType() == kJsExecutionProvider) { + candidates.push_back(node.Index()); + } continue; } @@ -659,17 +663,14 @@ std::vector> JsExecutionProvider::GetCapabili continue; } candidates.push_back(node.Index()); - // If the node was added by layout transformer, do not move it to CPU - if(node.Domain() != "com.ms.internal.nhwc"){ - LOGS(*GetLogger(), ERROR) << "Add node to tenative_candidates. node domain: " << node.Domain() << " node name: " << node.Name(); - tenative_candidates.push_back(node.Index()); - } + tenative_candidates.push_back(node.Index()); } auto cpu_nodes = GetCpuPreferredNodes(graph, kernel_lookup, tenative_candidates); std::vector> result; for (auto& node_index : candidates) { - if (cpu_nodes.count(node_index) > 0) + if (cpu_nodes.count(node_index) > 0) { continue; + } auto sub_graph = std::make_unique(); sub_graph->nodes.push_back(node_index);