Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOCS] Fixed KLDiv example #126857

Closed
wants to merge 5 commits into from
Closed

[DOCS] Fixed KLDiv example #126857

wants to merge 5 commits into from

Conversation

elisim
Copy link
Contributor

@elisim elisim commented May 22, 2024

Small import fix to make the example run

Copy link

pytorch-bot bot commented May 22, 2024

🔗 Helpful Links

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

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

✅ No Failures

As of commit 5528fd9 with merge base 8a45979 (image):
💚 Looks good so far! There are no failures yet. 💚

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

Copy link

linux-foundation-easycla bot commented May 22, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@elisim elisim changed the title Fixed KLDiv example [DOCS] Fixed KLDiv example May 22, 2024
@@ -449,6 +449,8 @@ class KLDivLoss(_Loss):
Examples::

>>> import torch.nn.functional as F
>>> from torch import nn
>>> import torch
Copy link
Contributor

@vadimkantorov vadimkantorov May 22, 2024

Choose a reason for hiding this comment

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

should maybe import torch be moved above import torch.nn.functional as F? also, style of from torch import nn does not match the style of import torch.nn.functional as F

I would propose (or at least make them the same style):

import torch
import torch.nn as nn
import torch.nn.functional as F

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure

Copy link
Collaborator

@albanD albanD left a comment

Choose a reason for hiding this comment

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

Hey!
Actually you should even remove the functional import from here as these are expected to always be already done in all our docstrings as you can see in the doctest config here:

pytorch/test/run_test.py

Lines 912 to 914 in 082251e

"from torch import nn",
"import torch.nn.functional as F",
"import torch",

@elisim elisim requested a review from albanD May 22, 2024 15:45
remove extra \n
Copy link
Collaborator

@albanD albanD left a comment

Choose a reason for hiding this comment

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

Thanks!

@albanD albanD added release notes: nn release notes category topic: docs topic category labels May 22, 2024
@albanD
Copy link
Collaborator

albanD commented May 22, 2024

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label May 22, 2024
@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: Not merging any PRs at the moment because there is a merge blocking https://github.com/pytorch/pytorch/labels/ci:%20sev issue open at:
#126896

Details for Dev Infra team Raised by workflow job

@mikaylagawarecki
Copy link
Contributor

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

titaiwangms pushed a commit to titaiwangms/pytorch that referenced this pull request May 28, 2024
Small import fix to make the example run
Pull Request resolved: pytorch#126857
Approved by: https://github.com/albanD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/trunk Trigger trunk jobs on your pull request Merged open source release notes: nn release notes category topic: docs topic category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants