From d111eed726f6009bd9c4bf3355194a3b85aabb9f Mon Sep 17 00:00:00 2001 From: Peishen Yan Date: Sat, 16 Dec 2023 00:57:07 +0800 Subject: [PATCH] [WebNN EP] Change axis to axes for argMax/argMin (#18838) In the latest spec, the axes option of WebNN's argMax and argMin requires the use of a sequence long type. Replace axis option (long type) with axes (sequence long type) for argMax and argMin. --- .../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 57a37d9233..5f8defe8fc 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();