code: def test_seg_res_net(self, device, use_ort):
      if use_ort:
          _, has_onnxruntime = optional_import("onnxruntime")
          if not has_onnxruntime:
              self.skipTest(
                  "onnxruntime is not installed probably due to python version >= 3.11."
              )
      model = SegResNet(
          spatial_dims=3,
          init_filters=32,
          in_channels=1,
          out_channels=105,
          dropout_prob=0.2,
          act=("RELU", {"inplace": True}),
          norm=("GROUP", {"num_groups": 8}),
          norm_name="",
          num_groups=8,
          use_conv_final=True,
          blocks_down=[1, 2, 2, 4],
          blocks_up=[1, 1, 1],
      )
      onnx_model = convert_to_onnx(
          model=model,
          inputs=[torch.randn((1, 1, 24, 24, 24), requires_grad=False)],
          input_names=["x"],
          output_names=["y"],
          verify=True,
          device=device,
          use_ort=use_ort,
          use_trace=True,
          rtol=1e-3,
          atol=1e-4,
      )
      self.assertTrue(isinstance(onnx_model, onnx.ModelProto))
  
file_path: MONAI/tests/test_convert_to_onnx.py
imports: from __future__ import annotations
  import itertools
  import unittest
  import torch
  from parameterized import parameterized
  from monai.networks import convert_to_onnx
  from monai.networks.nets import SegResNet, UNet
  from monai.utils.module import pytorch_after
  from tests.utils import SkipIfBeforePyTorchVersion, SkipIfNoModule, optional_import, skip_if_quick
label_desc: Use image node_id 2 for calling the TestConvertToOnnx obj's underlying member method code with example usage: obj.test_seg_res_net(device, use_ort) without return types