-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Conversation
"""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) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea.
No description provided.