code: def test_compute_exception():
      """Task.compute returns (False, exc_info) on failure."""
  
      def zero_div():
          0 / 0
  
      with spawn_workers([torch.device("cpu")]) as (
          in_queues,
          out_queues,
      ):
          t = Task(CPUStream, compute=zero_div, finalize=None)
          in_queues[0].put(t)
          ok, exc_info = out_queues[0].get()
  
          assert not ok
          assert isinstance(exc_info, tuple)
          assert issubclass(exc_info[0], ZeroDivisionError)
  
file_path: pytorch/test/distributed/pipeline/sync/test_worker.py
imports: import threading
  import pytest
  import torch
  from torch.distributed.pipeline.sync.microbatch import Batch
  from torch.distributed.pipeline.sync.stream import CPUStream
  from torch.distributed.pipeline.sync.worker import Task, spawn_workers
  from torch.testing._internal.common_utils import run_tests
label_desc: Use image node_id 3 for calling a global function with example usage: test_compute_exception() without return types