Skip to content

Commit 7c9cdc9

Browse files
author
pytorchbot
committed
2026-02-05 nightly release (b7d9102)
1 parent be75e3a commit 7c9cdc9

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

CONTRIBUTING.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,10 @@ Tests that require internet access should be in
169169
Torchvision uses [Google style](http://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html)
170170
for formatting docstrings. Length of line inside docstrings block must be limited to 120 characters.
171171

172-
Please, follow the instructions to build and deploy the documentation locally.
172+
All documentation is built for each PR and contains a preview on the PR.
173+
However, it is often useful to build the docs locally when making a lot of
174+
documentation changes. Please, follow the instructions to build and deploy the
175+
documentation locally.
173176

174177
#### Install requirements
175178

@@ -209,6 +212,35 @@ You can also choose to only build a subset of the examples by using the
209212
example ``EXAMPLES_PATTERN="transforms" make html`` will only build the examples
210213
with "transforms" in their name.
211214

215+
#### Serving docs locally (if building from a GPU env)
216+
217+
If you're developing locally, you can just open the generated `index.html` file
218+
in your browser.
219+
220+
If instead you're using a remote machine, you can use a combination of a simple
221+
python HTTP server and port forwarding to serve the docs locally. This allows
222+
you to iterate on the documentation much more quickly than relying on PR
223+
previews.
224+
225+
To do so, after following the above doc build steps, run the following from the
226+
`docs/build/html` folder:
227+
228+
```
229+
python -m http.server 8000 # or any free port
230+
```
231+
232+
This will open up a simple HTTP server serving the files in the build directory.
233+
If this is done on a remote machine, you can set up port forwarding from your
234+
local machine to access the server, for example:
235+
236+
```
237+
ssh -L 9000:localhost:8000 $REMOTE_DEV_HOST
238+
```
239+
240+
Now, you can navigate to `localhost:9000` on your local machine to view
241+
the rendered documentation.
242+
243+
212244
### New architecture or improved model weights
213245

214246
Please refer to the guidelines in [Contributing to Torchvision - Models](https://github.com/pytorch/vision/blob/main/CONTRIBUTING_MODELS.md).

0 commit comments

Comments
 (0)