Skip to content

Commit

Permalink
Add stable API references (#2399)
Browse files Browse the repository at this point in the history
Summary: Pull Request resolved: #2399

Differential Revision: D62700154
  • Loading branch information
PaulZhang12 authored and facebook-github-bot committed Sep 17, 2024
1 parent 4fb2d00 commit 8e5f839
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
sphinx==5.0.0
myst_parser
pyre-extensions
# torch
# PyTorch Theme
Expand Down
2 changes: 1 addition & 1 deletion docs/source/_templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{{ super() }}

<script type="text/javascript">
var collapsedSections = ['Introduction', 'All API References']
var collapsedSections = ['Introduction', 'Stable API References', 'All API References']
</script>

{% endblock %}
6 changes: 5 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ["sphinx.ext.napoleon", "sphinx.ext.autodoc"]
extensions = [
"sphinx.ext.napoleon",
"sphinx.ext.autodoc",
"myst_parser",
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
Expand Down
11 changes: 11 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@ TorchRec API

overview.rst

.. toctree::
:maxdepth: 2
:caption: Stable API References
:hidden:

stable/datatypes-api-reference.rst
stable/modules-api-reference.rst
stable/planner-api-reference.rst
stable/model-parallel-api-reference.rst
stable/inference-api-reference.rst

.. toctree::
:maxdepth: 1
:caption: All API References
Expand Down
10 changes: 10 additions & 0 deletions docs/source/stable/datatypes-api-reference.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
TorchRec DataTypes API Reference
----------------------------------

.. automodule:: torchrec.sparse.jagged_tensor

.. autoclass:: JaggedTensor

.. autoclass:: KeyedJaggedTensor

.. autoclass:: KeyedTensor
7 changes: 7 additions & 0 deletions docs/source/stable/inference-api-reference.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
TorchRec Inference API Reference
----------------------------------

.. automodule:: torchrec.inference.modules

.. autofunction:: quantize_inference_model
.. autofunction:: shard_quant_model
6 changes: 6 additions & 0 deletions docs/source/stable/model-parallel-api-reference.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
TorchRec Model Parallel API Reference
----------------------------------

.. automodule:: torchrec.distributed.model_parallel

.. autoclass:: DistributedModelParallel
7 changes: 7 additions & 0 deletions docs/source/stable/modules-api-reference.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
TorchRec Modules API Reference
----------------------------------

.. automodule:: torchrec.modules.embedding_modules

.. autoclass:: EmbeddingBagCollection
.. autoclass:: EmbeddingCollection
2 changes: 2 additions & 0 deletions docs/source/stable/planner-api-reference.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
TorchRec Planner API Reference
----------------------------------

0 comments on commit 8e5f839

Please sign in to comment.