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

Replace deprecated Variable class #29

Open
fredpolicarpo opened this issue Aug 9, 2018 · 2 comments
Open

Replace deprecated Variable class #29

fredpolicarpo opened this issue Aug 9, 2018 · 2 comments

Comments

@fredpolicarpo
Copy link

w = Variable(torch.Tensor([1.0]), requires_grad=True) # Any random value

The class torch.autograd.Variable is deprecated.

This line must be updated to

w = torch.tensor([1.0], requires_grad=True) # Any random value

@Vermeille
Copy link

I really don't get why everyone is still using Variable. It's deprefuckingcated 😆

@hchen98
Copy link

hchen98 commented Mar 11, 2020

w = Variable(torch.Tensor([1.0]), requires_grad=True) # Any random value

The class torch.autograd.Variable is deprecated.

This line must be updated to

w = torch.tensor([1.0], requires_grad=True) # Any random value

Thanks for the update. It is funny when I code in PyCharm because the IDE suggests the 'w = torch.tensor([1.0], requires_grad=True)' is discouraged...

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

No branches or pull requests

3 participants