code: def test_pytorch_cuda_context():
      # Create a dummy torch CUDA tensor so we acquire CUDA context
      cuda0 = torch.device("cuda:0")
      _ = torch.ones([1, 1], dtype=torch.float32, device=cuda0)
      callback = utils.ExtCallback((4, 5), 10, np.int32)
      pipe = utils.create_pipe(
          callback,
          "cpu",
          5,
          py_num_workers=6,
          py_start_method="fork",
          parallel=True,
      )
      pipe.start_py_workers()
  
file_path: DALI/dali/test/python/test_external_source_parallel_pytorch.py
imports: import numpy
  import torch
  import test_external_source_parallel_utils
  from nose_utils import raises
label_desc: Use image node_id 1 for calling a global function with example usage: test_pytorch_cuda_context() without return types