code: def test_load_weights_with_net_override(
      self, bundle_name, device, net_override
  ):
      with skip_if_downloading_fails():
          # download bundle, and load weights from the downloaded path
          with tempfile.TemporaryDirectory() as tempdir:
              # load weights
              model = load(
                  name=bundle_name,
                  bundle_dir=tempdir,
                  source="monaihosting",
                  progress=False,
                  device=device,
                  return_state_dict=False,
              )
  
              # prepare data and test
              input_tensor = torch.rand(1, 1, 96, 96, 96).to(device)
              output = model(input_tensor)
              model_path = (
                  f"{tempdir}/spleen_ct_segmentation/models/model.pt"
              )
              workflow = create_workflow(
                  config_file=f"{tempdir}/spleen_ct_segmentation/configs/train.json",
                  workflow_type="train",
              )
              expected_model = workflow.network_def.to(device)
              expected_model.load_state_dict(torch.load(model_path))
              expected_output = expected_model(input_tensor)
              assert_allclose(
                  output,
                  expected_output,
                  atol=1e-4,
                  rtol=1e-4,
                  type_test=False,
              )
  
              # using net_override to override kwargs in network directly
              model_2 = load(
                  name=bundle_name,
                  bundle_dir=tempdir,
                  source="monaihosting",
                  progress=False,
                  device=device,
                  return_state_dict=False,
                  net_override=net_override,
              )
  
              # prepare data and test
              input_tensor = torch.rand(1, 1, 96, 96, 96).to(device)
              output = model_2(input_tensor)
              expected_shape = (1, 5, 96, 96, 96)
              np.testing.assert_equal(output.shape, expected_shape)
  
imports: from __future__ import annotations
  import json
  import os
  import tempfile
  import unittest
  from unittest.case import skipUnless
  import numpy
  import torch
  from parameterized import parameterized
  import monai.networks.nets
  from monai.apps import check_hash
  from monai.bundle import ConfigParser, create_workflow, load
  from monai.utils import optional_import
  from tests.utils import SkipIfBeforePyTorchVersion, assert_allclose, command_line_tests, skip_if_downloading_fails, skip_if_no_cuda, skip_if_quick
label_desc: Use image node_id 2 for calling the TestLoad obj's underlying member method code with example usage: obj.test_load_weights_with_net_override(bundle_name, device, net_override) without return types