You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary:
Pull Request resolved: #737
- Fix links to tutorials
- Add logic to copy .md files from "tutorials_source/" to "tutorials/" so that they can be added to the build and have urls like tutorials/<tutorial_name>.html instead of tutorials_source/...
* Update instructions on how to add a tutorial from a dir outside of doc build.
Reviewed By: dbort
Differential Revision: D50091328
fbshipit-source-id: 1632fc027fd9a91b44306c5bd697e5c7223aba99
In the `index.rst` file, I would add `tutorials/selective-build-tutorial` in
190
+
both the `toctree` and the `cusotmcarditem` sections.
191
+
142
192
# Auto-generated API documentation
143
193
144
194
On a high level (will go into detail later), we use Sphinx to generate both
145
195
Python and C++ documentation in the form of HTML pages.
146
196
147
197
### Python APIs
148
198
149
-
We generate Python API documentation through Sphinx, bootstrapping[PyTorch's
150
-
Sphinx theme](https://github.com/pytorch/pytorch_sphinx_theme) for
151
-
a cohesive look with the existing PyTorch API documentation.
199
+
We generate Python API documentation through Sphinx, bootstrapping
200
+
[PyTorch's Sphinx theme](https://github.com/pytorch/pytorch_sphinx_theme) for a
201
+
cohesive look with the existing PyTorch API documentation.
152
202
153
203
The setup for Python documentation lies within `source_py/`. To set up Sphinx, a
154
204
`conf.py` configuration file is required. We can specify ways to generate
155
205
documentation here. Specifically, the most important/relevant parts are:
156
206
157
-
* Make sure to add a path to the directory above the directory you're trying to generate documentation for. For example, since we want to generate documentation for the `executorch/` directory. This tells Sphinx where to find the code to generate docs for.
207
+
- Make sure to add a path to the directory above the directory you're trying to
208
+
generate documentation for. For example, since we want to generate
209
+
documentation for the `executorch/` directory. This tells Sphinx where to find
210
+
the code to generate docs for.
158
211
159
-
*`extensions` contains extension modules. For auto-generating APIs, make sure to include `sphinx.ext.autodoc`.
160
-
*`autodoc_mock_imports` is where you put imports that Sphinx is unable to access. Sphinx runs your code in order to autogenerate the docs, so for any libraries that it unable to access due to it being outside of the directory, or containing c++ bindings, we need to specify it in the `autodoc_mock_imports` list. You can see what modules Sphinx is confused by when you run into importing errors when generating docs.
212
+
-`extensions` contains extension modules. For auto-generating APIs, make sure
213
+
to include `sphinx.ext.autodoc`.
214
+
-`autodoc_mock_imports` is where you put imports that Sphinx is unable to
215
+
access. Sphinx runs your code in order to autogenerate the docs, so for any
216
+
libraries that it unable to access due to it being outside of the directory,
217
+
or containing c++ bindings, we need to specify it in the
218
+
`autodoc_mock_imports` list. You can see what modules Sphinx is confused by
219
+
when you run into importing errors when generating docs.
161
220
162
221
Additionally, RST files are needed in order to specify the structure of the
163
222
auto-generated pages and to tell Sphinx what modules to generate documentation
@@ -177,22 +236,21 @@ executorch.exir
177
236
:show-inheritance:
178
237
```
179
238
180
-
These separate RST files should all be linked together, with the initial
181
-
landing page under `index.rst`. A sample of this structure can be found in
182
-
`source_py/`.
239
+
These separate RST files should all be linked together, with the initial landing
240
+
page under `index.rst`. A sample of this structure can be found in `source_py/`.
183
241
184
-
A diagram of how the files work together:
185
-

242
+
A diagram of how the files work together: 
186
243
187
244
To view your changes on the ExecuTorch website, you can follow the same steps
188
245
listed in the "General Documentation" section.
189
246
190
247
To view just the auto-generated pages:
248
+
191
249
1.`cd executorch/docs/`
192
-
2.`sphinx-build -M html source_py sphinxbuild_py`
193
-
to build Sphinx and generate APIs any packages.
194
-
3.`python3 -m http.server 8000 --directory sphinxbuild_py/html` to view your HTML
195
-
files at `localhost:8000`.
250
+
2.`sphinx-build -M html source_py sphinxbuild_py` to build Sphinx and generate
251
+
APIs any packages.
252
+
3.`python3 -m http.server 8000 --directory sphinxbuild_py/html` to view your
253
+
HTML files at `localhost:8000`.
196
254
197
255
### C++ APIs
198
256
@@ -212,22 +270,21 @@ To configure Doxygen, we can run `doxygen -g` in the root of our repository (ex.
212
270
generating c++ documentation. Specifically, the most important/relevant parts
213
271
are:
214
272
215
-
*`OUTPUT_DIRECTORY` specifies where to output the auto-generated XML files
216
-
*`INPUT` specifies which files to generate documenation for
217
-
*`GENERATE_XML = YES`
273
+
-`OUTPUT_DIRECTORY` specifies where to output the auto-generated XML files
274
+
-`INPUT` specifies which files to generate documenation for
Copy file name to clipboardExpand all lines: docs/source/build-run-xtensa.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@ On top of being able to run on the Xtensa HiFi4 DSP another goal of this tutoria
41
41
42
42
::::{grid} 2
43
43
:::{grid-item-card} What you will learn in this tutorial:
44
-
:class-card: card-learn
44
+
:class-card: card-prerequisites
45
45
* In this tutorial you will learn how to export a quantized model with linear and batch norm ops targeted for the Xtensa HiFi4 DSP.
46
46
* You will also learn how to compile and deploy the ExecuTorch runtime with the kernels required for running the quantized model generated in the previous step on the Xtensa HiFi4 DSP.
0 commit comments