Skip to content

Commit 4d423c4

Browse files
JacobSzwejbkafacebook-github-bot
authored andcommitted
add cpp api reference
Differential Revision: D49924199
1 parent dfd947a commit 4d423c4

File tree

3 files changed

+96
-0
lines changed

3 files changed

+96
-0
lines changed

docs/source/conf.py

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
4444
sys.path.insert(0, os.path.abspath("../../"))
4545

4646
extensions = [
47+
"breathe",
48+
"exhale",
4749
"sphinx.ext.autodoc",
4850
"sphinx.ext.autosectionlabel",
4951
"sphinx.ext.autosummary",
@@ -61,6 +63,59 @@
6163
"executorch_custom_versions",
6264
]
6365

66+
# Setup absolute paths for communicating with breathe / exhale where
67+
# items are expected / should be trimmed by.
68+
# This file is {repo_root}/docs/cpp/source/conf.py
69+
this_file_dir = os.path.abspath(os.path.dirname(__file__))
70+
doxygen_xml_dir = os.path.abspath("../website/sphinxbuild_cpp/xml")
71+
repo_root = os.path.dirname( # {repo_root}
72+
os.path.dirname( # {repo_root}/docs
73+
os.path.dirname( # {repo_root}/docs/cpp
74+
this_file_dir # {repo_root}/docs/cpp/source
75+
)
76+
)
77+
)
78+
79+
breathe_projects = {"PyTorch": doxygen_xml_dir}
80+
breathe_default_project = "PyTorch"
81+
82+
# Setup the exhale extension
83+
exhale_args = {
84+
############################################################################
85+
# These arguments are required. #
86+
############################################################################
87+
"containmentFolder": "./cpp_api",
88+
"rootFileName": "library_root.rst",
89+
"rootFileTitle": "Library API",
90+
"doxygenStripFromPath": repo_root,
91+
############################################################################
92+
# Suggested optional arguments. #
93+
############################################################################
94+
"createTreeView": True,
95+
"exhaleExecutesDoxygen": True,
96+
"exhaleUseDoxyfile": True,
97+
"verboseBuild": True,
98+
############################################################################
99+
# HTML Theme specific configurations. #
100+
############################################################################
101+
# Fix broken Sphinx RTD Theme 'Edit on GitHub' links
102+
# Search for 'Edit on GitHub' on the FAQ:
103+
# http://exhale.readthedocs.io/en/latest/faq.html
104+
"pageLevelConfigMeta": ":github_url: https://github.com/pytorch/pytorch",
105+
############################################################################
106+
# Individual page layout example configuration. #
107+
############################################################################
108+
# Example of adding contents directives on custom kinds with custom title
109+
"contentsTitle": "Page Contents",
110+
"kindsWithContentsDirectives": ["class", "file", "namespace", "struct"],
111+
# Exclude PIMPL files from class hierarchy tree and namespace pages.
112+
"listingExclude": [r".*Impl$"],
113+
############################################################################
114+
# Main library page layout example configuration. #
115+
############################################################################
116+
"afterTitleDescription": "Welcome to the ExecuTorch's documentation.",
117+
}
118+
64119
templates_path = ["_templates"]
65120

66121

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
ExecuTorch Runtime API Reference
2+
================================
3+
4+
The ExecuTorch C++ API provides an on-device execution framework for exported PyTorch models.
5+
6+
For a tutorial style introduction to the runtime API, check out the
7+
<TODO Insert Tutorial Link Here When It Exists> tutorial.
8+
9+
Model Loading and Execution
10+
---------------------------
11+
12+
.. doxygenclass:: torch::executor::DataLoader
13+
:members:
14+
15+
.. doxygenclass:: torch::executor::MemoryAllocator
16+
:members:
17+
18+
.. doxygenclass:: torch::executor::HierarchicalAllocator
19+
:members:
20+
21+
.. doxygenclass:: torch::executor::MemoryManager
22+
:members:
23+
24+
.. doxygenclass:: torch::executor::Program
25+
:members:
26+
27+
.. doxygenclass:: torch::executor::Method
28+
:members:
29+
30+
.. doxygenclass:: torch::executor::MethodMeta
31+
:members:
32+
33+
Values
34+
------
35+
36+
.. doxygenclass:: torch::executor::EValue
37+
:members:
38+
39+
.. doxygenclass:: torch::executor::Tensor
40+
:members:

docs/source/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ Topics in this section will help you get started with ExecuTorch.
100100
:hidden:
101101

102102
export-to-executorch-api-reference
103+
executorch-runtime-api-reference
103104

104105
.. toctree::
105106
:glob:

0 commit comments

Comments
 (0)