onnxruntime
onnxruntime copied to clipboard
[QNN EP] Support NonZero.
Description
- Implement NonZero op builder and regsiter QDQ selector.
- Implement ShapeNonZero QNN preprocess to fix shape. Test: UTs.
Motivation and Context
Unlike ONNX NonZero which normally has dynamic output shape, QNN defines NonZero to always have maximum output size to avoid the dynamic shape. In order to meet QNN's expectation, the model with NonZero node must be preprocessed first to fix the shape beforehand. Additionally, QNN NonZero has shape in [#elements, rank] and thus an extra Transpose is required.