Skip to content

Instantly share code, notes, and snippets.

@geohot
Last active June 13, 2022 21:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save geohot/a7b10a1fb8da8621c65412c028c73512 to your computer and use it in GitHub Desktop.
Save geohot/a7b10a1fb8da8621c65412c028c73512 to your computer and use it in GitHub Desktop.
import torch
torch.set_grad_enabled(False)
model = torch.nn.Linear(1, 1, bias=False).cuda()
model.weight[:] = 1.
print(model(torch.Tensor([2349.]).cuda()))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment