Repository: opencv
Issue: OpenCV(4.7.0-dev) /opencv/modules/dnn/src/cuda/padding.cu:155: error: (-215:Assertion failed) inShape[j] = outShape[j] in function ‘copy_with_reflection101’
Labels: bug,category: gpu/cuda (contrib),category: dnn

### System Information

OpenCV version: 4.7.0-dev
Operating System / Platform: Ubuntu 18.04 
Compiler & compiler version: GCC 7.5.0

CUDA info:
```
Device 0: "NVIDIA Tegra X1"
  CUDA Driver Version / Runtime Version          10.20 / 10.20
  CUDA Capability Major/Minor version number:    5.3
  Total amount of global memory:                 3964 MBytes (4156661760 bytes)
  GPU Clock Speed:                               0.92 GHz
  Max Texture Dimension Size (x,y,z)             1D=(65536), 2D=(65536,65536), 3D=(4096,4096,4096)
  Max Layered Texture Size (dim) x layers        1D=(16384) x 2048, 2D=(16384,16384) x 2048
  Total amount of constant memory:               65536 bytes
  Total amount of shared memory per block:       49152 bytes
  Total number of registers available per block: 32768
  Warp size:                                     32
  Maximum number of threads per block:           1024
  Maximum sizes of each dimension of a block:    1024 x 1024 x 64
  Maximum sizes of each dimension of a grid:     2147483647 x 65535 x 65535
  Maximum memory pitch:                          2147483647 bytes
  Texture alignment:                             512 bytes
  Concurrent copy and execution:                 Yes with 1 copy engine(s)
  Run time limit on kernels:                     Yes
  Integrated GPU sharing Host Memory:            Yes
  Support host page-locked memory mapping:       Yes
  Concurrent kernel execution:                   Yes
  Alignment requirement for Surfaces:            Yes
  Device has ECC support enabled:                No
  Device is using TCC driver mode:               No
  Device supports Unified Addressing (UVA):      Yes
  Device PCI Bus ID / PCI location ID:           0 / 0
  Compute Mode:
      Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) 

deviceQuery, CUDA Driver = CUDART, CUDA Driver Version  = 10.20, CUDA Runtime Version = 10.20, NumDevs = 1
```

### Detailed description

I have a semantic segmentation network with an input blob of 2 x 3 x 1152 x 1024 (generated via `dnn::blobFromImages`) and output size 2 x 3 x 1152 x 1024. It works fine with CPU, however, setting the backend and target to CUDA gives the error:

`OpenCV(4.7.0-dev) /opencv/modules/dnn/src/cuda/padding.cu:155: error: (-215:Assertion failed) inShape[j] = outShape[j] in function ‘copy_with_reflection101’`

### Steps to reproduce

**Code that reproduces the error:**
```
dnn::Net net = dnn::readNetFromONNX("unetformer_simpl.onnx");
net.setPreferableBackend(dnn::DNN_BACKEND_CUDA);
net.setPreferableTarget(dnn::DNN_TARGET_CUDA);

Mat patch0 = imread("patch0.png", IMREAD_COLOR);
Mat patch1 = imread("patch1.png", IMREAD_COLOR);

vector<Mat> batch = { patch0, patch1 };
Mat blob = dnn::blobFromImages(batch, 1.0, Size(), Scalar(), false, false, CV_32F);
net.setInput(blob);
Mat output = net.forward();
```

**Model & test data:**
https://drive.google.com/drive/folders/12WBxjZEkzdE0QrWfUBBzHbVF2ijfMZOM?usp=sharing

### 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 any solution
- [X] I updated to the latest OpenCV version and the issue is still there
- [X] There is reproducer code and related data files (videos, images, onnx, etc)