Skip to content

Commit

Permalink
[WebNN EP] Add outputDataType option for the ArgMax/ArgMin ops
Browse files Browse the repository at this point in the history
  • Loading branch information
Honry committed Jul 19, 2024
1 parent 9140d9b commit ca89be0
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ Status ArgMaxMinOpBuilder::AddToModelBuilderImpl(ModelBuilder& model_builder,
options.set("axes", axes);
options.set("keepDimensions", keep_dims == 1);
options.set("selectLastIndex", select_last_index == 1);
// TODO: use WebNN's opSupportLimits API to check the backend's supported output data types.

Check warning on line 53 in onnxruntime/core/providers/webnn/builders/impl/argmax_min_op_builder.cc

View workflow job for this annotation

GitHub Actions / Lint C++

[cpplint] reported by reviewdog 🐶 Missing username in TODO; it should look like "// TODO(my_username): Stuff." [readability/todo] [2] Raw Output: onnxruntime/core/providers/webnn/builders/impl/argmax_min_op_builder.cc:53: Missing username in TODO; it should look like "// TODO(my_username): Stuff." [readability/todo] [2]
// If the backend doesn't support int64 output, we should use default int32 output data type
// then do a type casting (int32 -> int64) for the output. Refer to the CoreML EP for how to
// support int64 output.
options.set("outputDataType", "int64");
emscripten::val output = emscripten::val::object();

const auto& op_type = node.OpType();
Expand Down

0 comments on commit ca89be0

Please sign in to comment.