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

Add .detach() in scalar_to_float() #551

Closed
wants to merge 1 commit into from

Conversation

gunchu
Copy link
Contributor

@gunchu gunchu commented Sep 25, 2023

Summary:
Calling from an integration test with full training loop that used in mem logger was throwing this exception:

RuntimeError: Can't call numpy() on Tensor that requires grad. Use tensor.detach().numpy() instead.

This diff adds the .detach()

Reviewed By: JKSenthil

Differential Revision: D49600572

Summary:
Calling from an integration test with full training loop that used in mem logger was throwing this exception:
```
RuntimeError: Can't call numpy() on Tensor that requires grad. Use tensor.detach().numpy() instead.
```

This diff adds the `.detach()`

Reviewed By: JKSenthil

Differential Revision: D49600572
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D49600572

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.

2 participants