class_docstr: Wrapper around a ``torch._C.Future`` which encapsulates an asynchronous
  execution of a callable, e.g. :meth:`~torch.distributed.rpc.rpc_async`. It
  also exposes a set of APIs to add callback functions and set results.
  
  .. warning:: GPU support is a beta feature, subject to changes.
class_docstr_tok: ["Wrapper","around","a","``","torch._C.Future","``","which","encapsulates","an","asynchronous","execution","of","a","callable",",","e.g",".",":","meth",":","`","~torch.distributed.rpc.rpc_async","`",".","It","also","exposes","a","set","of","APIs","to","add","callback","functions","and","set","results",".","..","warning",":",":","GPU","support","is","a","beta","feature",",","subject","to","changes","."]
docstr: Create an empty unset ``Future``. If the future is intended to hold
  values containing CUDA tensors, (a superset of) their CUDA devices must
  be specified at construction. (This is only supported if
  ``torch.cuda.is_available()`` returns ``True``). This is needed to
  ensure proper CUDA stream synchronization. The child futures, returned
  by the ``then`` method, will inherit these devices.
  
  Args:
      devices(``List[Union[int, str, torch.device]]``, optional): the set
          of devices on which tensors contained in this future's value are
          allowed to reside and on which callbacks are allowed to operate.
docstr_tok: ["Create","an","empty","unset","``","Future","``",".","If","the","future","is","intended","to","hold","values","containing","CUDA","tensors",",","(","a","superset","of",")","their","CUDA","devices","must","be","specified","at","construction",".","(","This","is","only","supported","if","``","torch.cuda.is_available","(",")","``","returns","``","True","``",")",".","This","is","needed","to","ensure","proper","CUDA","stream","synchronization",".","The","child","futures",",","returned","by","the","``","then","``","method",",","will","inherit","these","devices",".","Args",":","devices","(","``","List","[","Union","[","int",",","str",",","torch.device","]","]","``",",","optional",")",":","the","set","of","devices","on","which","tensors","contained","in","this","future","'s","value","are","allowed","to","reside","and","on","which","callbacks","are","allowed","to","operate","."]
code: def __init__(
      self,
      *,
      devices: Optional[List[Union[int, str, torch.device]]] = None,
  ):
      r"""
      Create an empty unset ``Future``. If the future is intended to hold
      values containing CUDA tensors, (a superset of) their CUDA devices must
      be specified at construction. (This is only supported if
      ``torch.cuda.is_available()`` returns ``True``). This is needed to
      ensure proper CUDA stream synchronization. The child futures, returned
      by the ``then`` method, will inherit these devices.
  
      Args:
          devices(``List[Union[int, str, torch.device]]``, optional): the set
              of devices on which tensors contained in this future's value are
              allowed to reside and on which callbacks are allowed to operate.
      """
      if devices is None:
          devices = []
      super().__init__([torch.device(d) for d in devices])
  
file_path: pytorch/torch/futures/__init__.py
imports: from __future__ import annotations
  from typing import cast, Callable, Generic, List, Optional, Type, TypeVar, Union
  import torch
label_desc: Use image node_id 1 to create a new Future object from inherited base classes: torch._C, Generic with example: obj = Future()