Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Eunjnnn
Copy link
Contributor

@Eunjnnn Eunjnnn commented Nov 25, 2021

Fixes #2265

Description: add doctest for Loss

Check list:

  • New tests are added (if a new feature is added)
  • New doc strings: description and/or example code are in RST format
  • Documentation is updated (if required)

@github-actions github-actions bot added the module: metrics Metrics module label Nov 25, 2021
@sdesrozis
Copy link
Contributor

@Eunjnnn Thank you very much for your help ! I left some comments, tell me if you need help.

@sdesrozis
Copy link
Contributor

@Eunjnnn Are you still working on this ? It would be great to merge soon.

@Eunjnnn Eunjnnn changed the title [skip ci] Doctest for Loss [skip ci] Doctest for 'Loss' Dec 5, 2021
@Eunjnnn Eunjnnn changed the title [skip ci] Doctest for 'Loss' [skip ci] Doctest for Loss Dec 5, 2021
@sdesrozis
Copy link
Contributor

@Eunjnnn Thanks for the update. It’s almost done, please do the fix I suggested. Thanks again !

.. testcode::
model = default_model
criterion = nll_loss
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
criterion = nll_loss
criterion = nn.NLLLoss()

import torch
from torch import nn, optim
from torch.nn.functional import nll_loss
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
from torch.nn.functional import nll_loss

See below, no need to introduce this import.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops! Thank you!!

Copy link
Contributor

@sdesrozis sdesrozis left a comment

Choose a reason for hiding this comment

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

@Eunjnnn Thank you ! LGTM

@sdesrozis sdesrozis merged commit 53238a9 into pytorch:master Dec 6, 2021
@Eunjnnn Eunjnnn deleted the doctest_loss branch December 6, 2021 14:03
@sdesrozis sdesrozis mentioned this pull request Dec 6, 2021
51 tasks
Ishan-Kumar2 pushed a commit to Ishan-Kumar2/ignite that referenced this pull request Dec 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: metrics Metrics module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[docs] Add doctests for metrics

2 participants