Skip to content

Conversation

@sonnyding1
Copy link

Description

In the "Learning PyTorch with Examples" tutorial, the autograd code block started with rimport. This PR fixed the typo by removing r.

@pytorch-bot
Copy link

pytorch-bot bot commented Oct 22, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/tutorials/3619

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit c08690f with merge base 6b750ab (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla bot added the cla signed label Oct 22, 2025
Copy link
Contributor

@malfet malfet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r prefix in Python means raw string, i.e. one where does not need to escape \
I.e.

>>> print("\n")


>>> print(r"\n")
\n

@sonnyding1
Copy link
Author

r prefix in Python means raw string, i.e. one where does not need to escape \ I.e.

Thank you for the heads up, then it should be the problem of the includenodoc directive not parsing the docstring correctly. It seems includenodoc used to be defined in a file custom_directives.py, as mentioned in #550, but the file was removed, and the definition of includenodoc is moved outside of this repository.

Do you know where the includenodoc directive is maintained now? I'd be happy to create an issue and a pull request over there to fix this bug.

@svekars
Copy link
Contributor

svekars commented Oct 27, 2025

I guess we can update the regex here: https://github.com/pytorch/pytorch_sphinx_theme/blob/pytorch_sphinx_theme2/pytorch_sphinx_theme2/custom_directives.py#L39 to accommodate for raw strings. Not sure why it worked before with the old theme. includenodoc only used in that one file.

@sonnyding1
Copy link
Author

Thank you, I'll close this PR and submit another over there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants