[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.
This commit is contained in:
Peishen Yan 2023-12-16 00:57:07 +08:00 committed by GitHub
parent d795fc636c
commit d111eed726
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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<void>("push", static_cast<uint32_t>(axis));
emscripten::val options = emscripten::val::object();
options.set("axis", static_cast<int32_t>(axis));
options.set("axes", axes);
options.set("keepDimensions", keep_dims == 1);
options.set("selectLastIndex", select_last_index == 1);
emscripten::val output = emscripten::val::object();