Skip to content

Instantly share code, notes, and snippets.

@zou3519
Created October 19, 2017 02:17
Show Gist options
  • Save zou3519/f13145cafbb873a855ef524d6607125a to your computer and use it in GitHub Desktop.
Save zou3519/f13145cafbb873a855ef524d6607125a to your computer and use it in GitHub Desktop.
This script gets stuck, but only on some machines...
from torch import nn
from torch.autograd import Variable
import torch
l = nn.Linear(5,5).cuda()
pl = nn.DataParallel(l)
print("Checkpoint 1")
a = Variable(torch.rand(5,5).cuda(), requires_grad=True)
print("Checkpoint 2")
print(pl(a)) # Here it gets stuck
print("Checkpoint 3")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment