From f3b3b9b59b82950fc1e737acfa2baf8b4136088e Mon Sep 17 00:00:00 2001 From: peishenyan Date: Fri, 15 Dec 2023 12:47:59 +0800 Subject: [PATCH] [WebNN EP] Change axis to axes for argMax/argMin In the latest spec, the axes option of WebNN's argMax and argMin requires the use of a sequence long type. --- .../providers/webnn/builders/impl/argmax_min_op_builder.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/onnxruntime/core/providers/webnn/builders/impl/argmax_min_op_builder.cc b/onnxruntime/core/providers/webnn/builders/impl/argmax_min_op_builder.cc index 57a37d92335aa..5f8defe8fcb6b 100644 --- a/onnxruntime/core/providers/webnn/builders/impl/argmax_min_op_builder.cc +++ b/onnxruntime/core/providers/webnn/builders/impl/argmax_min_op_builder.cc @@ -41,9 +41,11 @@ Status ArgMaxMinOpBuilder::AddToModelBuilderImpl(ModelBuilder& model_builder, const auto select_last_index = helper.Get("select_last_index", 0); axis = HandleNegativeAxis(axis, input_rank); + emscripten::val axes = emscripten::val::array(); + axes.call("push", static_cast(axis)); emscripten::val options = emscripten::val::object(); - options.set("axis", static_cast(axis)); + options.set("axes", axes); options.set("keepDimensions", keep_dims == 1); options.set("selectLastIndex", select_last_index == 1); emscripten::val output = emscripten::val::object();