code: def test_spawn_new_process():
      x = torch.rand(2, 3, 224, 224)
      model = resnet18(pretrained=True)
  
      original_thread = torch.get_num_threads()
  
      new_throughput_helper = spawn_new_process(throughput_helper)
      _, thread = new_throughput_helper(model, x)
      assert thread == original_thread
  
      _, thread = new_throughput_helper(
          model, x, env_var={"OMP_NUM_THREADS": "1"}
      )
      assert thread == 1
  
      _, thread = new_throughput_helper(
          model, x, env_var={"OMP_NUM_THREADS": "2"}
      )
      assert thread == 2
  
file_path: BigDL/python/nano/test/pytorch/tests/test_utils.py
imports: import tempfile
  import os
  import torch
  import time
  from bigdl.nano.utils.common import spawn_new_process
  from torchvision.models import resnet18
label_desc: Use image node_id 2 for calling a global function with example usage: test_spawn_new_process() without return types