Commits


Rachel Guo authored and GitHub committed 30bb0959dc5
[NNAPI EP] Add ReduceMean Op support (#16294) ### Description <!-- Describe your changes. --> As title. Special cases for ReduceMean: [UPDATE] The following cases are supported now by converting to providing an input with all axes for NNAPI. Behaviors when axes is not provided or axes provided as an empty vector: For ReduceMean Opset version 18: - Support case `axes` is provided as empty with `noop_with_empty_axes` set to true. - Support case `axes` is not provided with `noop_with_empty_axes` set to true. All treat as identity op. - Does not support the case when `axes` is not provided/provided as empty but `noop_with_empty_axes` is set to false. For ReduceMean OpSet Version 13-: - Does not support when `axes` attribute is not provided. (as onnx treats it as default behavior to reduce all dimensions, and the case is not implemented by NNAPI.) https://developer.android.com/ndk/reference/group/neural-networks#group___neural_networks_1ggaabbe492c60331b13038e39d4207940e0a047fe95a35b27f45c05432b6ca18eb6c > 1: A 1-D Tensor of [ANEURALNETWORKS_TENSOR_INT32](https://developer.android.com/ndk/reference/group/neural-networks#group___neural_networks_1ggaf06d1affd33f3bc698d0c04eceb23298ac34965d8e76ac5acfddf5acd9e40f896). The dimensions to reduce. Must be in the range [-rank(input_tensor), rank(input_tensor)).NOTE: When the operation was introduced, the documentation incorrectly stated that if dimensions were empty, the operation would reduce across all dimensions. This behavior was never implemented. ### Motivation and Context <!-- - Why is this change required? What problem does it solve? - If it fixes an open issue, please link to the issue here. --> Fixes issue #16194 --------- Co-authored-by: rachguo <rachguo@rachguos-Mini.attlocal.net>