Repository: opencv
Issue: ONNX conformance test results
Labels: bug,feature,effort: ∞,category: dnn (onnx)

##### System information (version)

- OpenCV => 4.5.4
- Operating System / Platform => Linux
- Compiler => g++ 8.4.0

##### Detailed description

I ran ONNX conformance tests from official [repo](https://github.com/onnx/onnx/tree/master/onnx/backend/test/data/node), and the found the following issues:

- `DataLayer`
    - [x] Forward fails doe to wrong size access on DataLayer. https://github.com/opencv/opencv/issues/25070
    
- `Add`
    - [x] lack of broadcasting; https://github.com/opencv/opencv/pull/21865

- `AveragePool`
    - [x] ceil_mode is set by checking the existence of pad_mode; https://github.com/opencv/opencv/pull/21159
    - [ ] `count_include_pad` not supported
    - [ ] `auto_pad` is deprecated, but we support it, but not making distinction between `same_upper` and `same_lower`


- `MaxPool`
    - [x] `ceil_mode` is set by checking the existence of `pad_mode`; https://github.com/opencv/opencv/pull/21159
    - [ ] `auto_pad` is deprecated, but we support it, but not making distinction between `same_upper` and `same_lower`
    - [ ] we seem to not support `dilations`


- `BatchNormalization`
    - [ ] `mean` blob is supported only as const


- `Clip`
    - [x] `min` and `max` shouldn't be differentiable, model error?; https://github.com/opencv/opencv/pull/22100
    - [x] defaults are wrong; https://github.com/opencv/opencv/pull/21152


- `Concat`
    - [ ] 2 input 1-d input mats with dims [2] become 2-d mats with dims [1, 2], axis=-1, hence `Concat` output dims are [2, 2] instead of [4]


- `Constant`
    - [ ] net is empty, technically, not an error?


- `ConvTranspose`
    - [ ] `W` blob is supported only as const


- `Div`
    - [x] does not support 1-d inputs (like everything else); https://github.com/opencv/opencv/pull/21865


- `ELU`
    - [x] not handling `alpha` parameter; https://github.com/opencv/opencv/pull/21160, https://github.com/opencv/opencv/pull/21161


- `Flatten`
    - [x] does not flatten before `axis`, if `axis`=0 outputs [X, 1] instead of [1, X]; https://github.com/opencv/opencv/pull/21283


- `Gemm`
    - [x] `B` blob is supported only as const, https://github.com/opencv/opencv/issues/21078#issuecomment-1933431728


- `GRU`
    - [ ] assumes optional inputs are present
    - [ ] support some inputs in const-only mode


- `InstanceNormalization`
    - [ ] `S` blob is supported only as const


- `LeakyReLU`
    - [x] default `alpha` should be 0.01; https://github.com/opencv/opencv/pull/21152


- `LogSoftMax`/`SoftMax`
    - [x] default `axis` should be -1 - if the opset is v11, otherwise it's 1
    - [x] `..._expanded` models should be fused; https://github.com/opencv/opencv/pull/21162


- `LRN`
    - [x] default `alpha` should be 0.0001; https://github.com/opencv/opencv/pull/21152


- `LSTM`
    - [ ] assumes optional inputs are present
    - [ ] support some inputs in const-only mode


- `Max/Min/Mul`
    - [x] does not support 1-d inputs (like everything else)


- `Pow`
    - [ ] second blob is supported only as const


- `PRelu`
    - [ ] `Slope` blob is supported only as const


- `ReduceMax/ReduceMean`
    - [x] doesn't handle 2-d input
    - [x] does not support reduce along some axis(0, if input is 3-d)
    - [x] doesn't support `keepdims`=true; https://github.com/opencv/opencv/pull/21259


- `ReduceSum`
    - [x] might be all above +; https://github.com/opencv/opencv/pull/22199
    - [x] `axes` arent handled as attributes, should be optional const input; https://github.com/opencv/opencv/pull/22199


- `Resize`
    - [ ] only first input should be differentiable, model error?


- `Split`
    - [x] default `axis` is set to 1 instead of 0; https://github.com/opencv/opencv/pull/21152


- `Sub`
    - [x] lack of broadcasting; https://github.com/opencv/opencv/pull/21865
    - [ ] does not support 1-d inputs (like everything else)


- `Sum`
    - [x] doesn't support only 1 input(identity?), https://github.com/opencv/opencv/pull/21164
    - [ ] does not support 1-d inputs (like everything else)


- `Transpose`
    - [x] does not reverse dimensions in absence of order, https://github.com/opencv/opencv/pull/21163


- `Upsample`
    - [ ] `scales` blob is supported only as const or attribute

- `AND`
    - [ ] fails while parsing graph. Issues is related to handing booleans, https://github.com/opencv/opencv/issues/24979
  

##### Steps to reproduce

Clone ONNX [repo](https://github.com/onnx/onnx), clone my [branch](https://github.com/rogday/opencv/tree/onnx_tests), fix paths in the code and run `opencv_test_dnn`.

##### Issue submission checklist

 - [X] I report the issue, it's not a question
 - [X] I checked the problem with documentation, FAQ, open issues,
       forum.opencv.org, Stack Overflow, etc and have not found solution
 - [X] I updated to latest OpenCV version and the issue is still there
 - [ ] There is reproducer code and related data files: videos, images, onnx, etc