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

Skip to content

Conversation

@sdesrozis
Copy link
Contributor

@sdesrozis sdesrozis commented Dec 10, 2021

Addresses #2265

Description: add doctest for Accuracy metric

@ydcjeff

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 Dec 10, 2021
@sdesrozis sdesrozis merged commit fb693e5 into pytorch:master Dec 12, 2021
@sdesrozis sdesrozis deleted the doctest_accuracy branch December 12, 2021 16:22
@sdesrozis sdesrozis mentioned this pull request Dec 12, 2021
51 tasks
Ishan-Kumar2 pushed a commit to Ishan-Kumar2/ignite that referenced this pull request Dec 26, 2021
metric = Accuracy()
metric.attach(default_evaluator, "accuracy")
y_true = torch.Tensor([2, 0, 2, 1, 0, 1]).long()
Copy link
Collaborator

Choose a reason for hiding this comment

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

@sdesrozis tensors should be created as torch.tensor(data) and not torch.Tensor(data) (it was deprecated since v0.4.0). torch.Tensor is only used for matching object vs class, e.g. isinstance(t, torch.Tensor).
Please fix that everywhere in doctest strings. Thanks

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.

2 participants