Skip to content

Remove line overwriting output #2839

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

Merged
merged 2 commits into from
Apr 24, 2024

Conversation

jmarintur
Copy link
Contributor

@jmarintur jmarintur commented Apr 17, 2024

Fixes #2827

Description

In the forward function of the CNN located in per_sample_grads.py, before the return, there is a line, L45, that is overwriting the output:

x = F.relu(x)
x = self.fc2(x)
output = F.log_softmax(x, dim=1)
output = x
return output

We simply need to remove it.

Checklist

  • The issue that is being fixed is referred in the description.
  • Only one issue is addressed in this pull request.
  • Labels from the issue that this PR is fixing are added to this pull request.
  • No unnecessary issues are included into this pull request.

cc @albanD

Copy link

pytorch-bot bot commented Apr 17, 2024

🔗 Helpful Links

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

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

✅ No Failures

As of commit 776baf9 with merge base 2dc81e5 (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
Contributor

@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.

Yep!

cc @svekars

@svekars svekars added the core Tutorials of any level of difficulty related to the core pytorch functionality label Apr 17, 2024
@svekars svekars merged commit 4c60331 into pytorch:main Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla signed core Tutorials of any level of difficulty related to the core pytorch functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Misleading example for per-sample gradient
4 participants