ArgMin, ArgMax operations.
ArgMin and ArgMax ops are needed to provide support for many ONNX operations.
It would be great if we could add them in the near future.
@arogowie-intel what's the semantics of ArgMin and ArgMax. Does it exactly match numpy's? Also, which backends do you guys need most of all?
Hi, The semantics of this operations is similar to the one in numpy's, however there are two slight differences.You can find ONNX specification of ArgMax, ArgMin here.
There is one additional optional argument keepdims which decides whether or not to prune reduced dimension. It is default to 1 which means to keep reduced dimension.
The second difference is that, numpy's version defaults to provide index from flattened array. Whereas ONNX doesn't specify any default value of argument axis which means it has to be provided.
As of the backends we do most of our testing on CPU currently.
keepdims is ONNX-specific; the bridge should follow by an explicit broadcast.
NumPy's treatment of axis isn't something we we would do as preceding with a reshape.
So I think it should be the ONNX def without keepdims and a required axis.
@diyessi I don't expect from you to implement those operations with exactly the same semantic as in ONNX standard. Just answered @Krovatkin's questions ;) There is no problem in adapting nGrpah behavior to ONNX standard (as far as it is possible at all) - actually that's what we do all the time in the bridge :)
@arogowie-intel Thank you!
@diyessi I was collecting the requirements :-) I was hoping I might have some free cycles to work on this Issue this sprint, since this is IA-transformer.
ArgMin and ArgMax support added