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

device-agnostic code #34

Merged
merged 2 commits into from
Jul 24, 2020
Merged

device-agnostic code #34

merged 2 commits into from
Jul 24, 2020

Conversation

jin-s13
Copy link
Collaborator

@jin-s13 jin-s13 commented Jul 24, 2020

No description provided.

@jin-s13 jin-s13 requested a review from innerlee July 24, 2020 12:48
"""Make zero inputs for AE loss.

Args:
t (torch.Tensor): input
requires_grad (bool): Option to use requires_grad.
need_cuda (bool): Opthin to use cuda.
device: torch device
Returns:
inp (torch.Tensor): zero input.
"""
inp = torch.autograd.Variable(t, requires_grad=requires_grad)
Copy link
Contributor

Choose a reason for hiding this comment

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

Unrelated to this pr, but Variable has been deprecated. https://pytorch.org/docs/stable/autograd.html#variable-deprecated

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we can remove all usage of Variables in a separate PR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good idea.

@innerlee innerlee merged commit d8e6741 into master Jul 24, 2020
@innerlee innerlee deleted the device branch July 24, 2020 14:33
rollingman1 pushed a commit to rollingman1/mmpose that referenced this pull request Nov 5, 2021
shuheilocale pushed a commit to shuheilocale/mmpose that referenced this pull request May 6, 2023
HAOCHENYE added a commit to HAOCHENYE/mmpose that referenced this pull request Jun 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants