code: def test_collect_all(self):
      fut1 = Future[int]()
      fut2 = Future[int]()
      fut_all = torch.futures.collect_all([fut1, fut2])
  
      def slow_in_thread(fut, value):
          time.sleep(0.1)
          fut.set_result(value)
  
      t = threading.Thread(target=slow_in_thread, args=(fut1, 1))
      fut2.set_result(2)
      t.start()
  
      res = fut_all.wait()
      self.assertEqual(res[0].wait(), 1)
      self.assertEqual(res[1].wait(), 2)
      t.join()
  
imports: import threading
  import time
  import torch
  import unittest
  from torch.futures import Future
  from torch.testing._internal.common_utils import IS_WINDOWS, TestCase, TemporaryFileName, run_tests
  from typing import TypeVar
label_desc: Use image node_id 22 for calling the TestFuture obj's underlying member method code with example usage: obj.test_collect_all() without return types