text: Title: Run  failed when using nms in batch infer
  Body: ### Search before asking
  
  - [x] I have searched the Ultralytics YOLO [issues](https://github.com/ultralytics/ultralytics/issues) and found no similar bug report.
  
  
  ### Ultralytics YOLO Component
  
  Export
  
  ### Bug
  
  I want to convert the model to ONNX format and integrate NMS into the model. However, after conversion, when I try to perform batch inference with dynamic shapes, I get a Split error. When I change the batch size during conversion, the error numbers also change accordingly. It only works correctly when the preset batch size matches the inference batch size. Is this because some tensor values were converted to constants somewhere? I hope to get an answer.
  
  err message:
  ```
  [E:onnxruntime:, sequential_executor.cc:516 ExecuteKernel] Non-zero status code returned while running Split node. Name:'/Split_2' Status Message: Cannot split using values in 'split' attribute. Axis=0 Input shape={3,8400} NumOutputs=1 Num entries in 'split' (must equal number of outputs) was 1 Sum of sizes in 'split' (must equal size of selected axis) was 1
  ```
  the split node:
  <img width="740" alt="Image" src="https://github.com/user-attachments/assets/a99745fd-0b79-4d2d-b6ed-efc33ddeb666" />
  
  ### Environment
  
  ultralytics 8.3.74
  torch 2.4.0
  onnx 1.17.0
  onnxruntime-gpu 1.19.0
  opencv-python  4.10.0.84
  python 3.12.4
  
  ### Minimal Reproducible Example
  
  export code:
  ```
  from ultralytics import YOLO
  import cv2
  import numpy as np
  
  model = YOLO('yolov11n-face.pt')  # load a pretrained YOLOv8n detection model
  image = cv2.imread('../datasets/face_test/image.jpg')
  results = model((image, image2, image3, image4))  # predict on an image
  
  model.export(format="onnx", nms=True, dynamic=True, simplify=True)
  ```
  test code:
  ```
  image = cv2.imread('../datasets/face_test/image1.jpg')
  image2 = cv2.imread('../datasets/face_test/image2.jpg')
  results = model((image, image2))  # predict on an image
  
  output_path = 'yolov11n-face.onnx'
  
  image_list = [image, image2]
  w = torch.Tensor([i.shape[0] for i in image_list]).to(model.device)
  h = torch.Tensor([i.shape[1] for i in image_list]).to(model.device)
  in_tensor = preprocess(image_list) # (2, 640, 640, 3)
  
  onnx_model = onnx.load(output_path)
  onnx.checker.check_model(onnx_model)
  ort_session = onnxruntime.InferenceSession(output_path)
  ort_inputs = {
      ort_session.get_inputs()[0].name: to_numpy(in_tensor.cpu())
  }
  # print(ort_inputs)
  for _ in range(1):
      ort_outs = ort_session.run(None, ort_inputs)
  
  print('onnx out:')
  print(ort_outs)
  ```
  
  ### Additional
  
  _No response_
  
  ### Are you willing to submit a PR?
  
  - [ ] Yes I'd like to help by submitting a PR!