mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Adding torch.futures to API docs (#40051)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/40051 Test Plan: Imported from OSS Differential Revision: D22055031 Pulled By: mrshenli fbshipit-source-id: ce8a79ba4ffdc7dbed6d4c62b1c33b96764c89e7
This commit is contained in:
committed by
Facebook GitHub Bot
parent
693ab77c00
commit
74142f76fa
24
docs/source/futures.rst
Normal file
24
docs/source/futures.rst
Normal file
@ -0,0 +1,24 @@
|
||||
.. currentmodule:: torch.futures
|
||||
|
||||
.. _futures-docs:
|
||||
|
||||
torch.futures
|
||||
=============
|
||||
|
||||
.. warning::
|
||||
The ``torch.futures`` package is experimental and subject to change.
|
||||
|
||||
|
||||
This package provides a :class:`~torch.futures.Future` type that encapsulates
|
||||
an asynchronous execution and a set of utility functions to simplify operations
|
||||
on :class:`~torch.futures.Future` objects. Currently, the
|
||||
:class:`~torch.futures.Future` type is primarily used by the
|
||||
:ref:`distributed-rpc-framework`.
|
||||
|
||||
.. automodule:: torch.futures
|
||||
|
||||
.. autoclass:: Future
|
||||
:members:
|
||||
|
||||
.. autofunction:: collect_all
|
||||
.. autofunction:: wait_all
|
@ -39,6 +39,7 @@ PyTorch is an optimized tensor library for deep learning using GPUs and CPUs.
|
||||
torch.cuda.amp <amp>
|
||||
torch.distributed <distributed>
|
||||
torch.distributions <distributions>
|
||||
futures
|
||||
torch.hub <hub>
|
||||
torch.jit <jit>
|
||||
nn.init
|
||||
@ -64,7 +65,7 @@ PyTorch is an optimized tensor library for deep learning using GPUs and CPUs.
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:caption: Libraries
|
||||
|
||||
|
||||
torchaudio <https://pytorch.org/audio>
|
||||
torchtext <https://pytorch.org/text>
|
||||
torchvision/index
|
||||
|
@ -1,7 +1,3 @@
|
||||
"""
|
||||
The ``torch.futures`` package contains a ``Future`` type and corresponding
|
||||
utility functions.
|
||||
"""
|
||||
import torch
|
||||
|
||||
|
||||
@ -10,9 +6,6 @@ class Future(torch._C.Future):
|
||||
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::
|
||||
The ``torch.futures.Future`` is experimental and subject to change.
|
||||
"""
|
||||
def __new__(cls):
|
||||
return super(Future, cls).__new__(cls)
|
||||
|
Reference in New Issue
Block a user