Skip to content

Consider changing output type of ArgMax/Argmin to int32, or allow passing output_type #653

@philloooo

Description

@philloooo

Currently WebNN specifies ArgMax/Min returns int64.

  • CoreML supported return type is int32 or uint16.
  • tflite supports int32, int64.
  • dml supports int32, int64, uint32, uint64.

Returning int64 can't be emulated on CoreML:

  • the cast operator only supports casting to fp16, fp32, i32, bool.
  • None of the operations support int64 as input(so the output of argMax/argMin can't be connected to the next layer if it's int64)
  • Graph output doesn't support i64. Only fp16, fp32, i32 is supported.

Given int32 is the intersection across these backends, I see two options to make it work:
a. Update argMin/Max to always output int32
b. On the spec level, allow passing a param of output_type. And allow probing the supported data types for this param.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions