Solved by ptrblck in post #4 
              
              
                I just checked it in 0.4.0 and apparently the import just seems to fail. 
Run the following: 
from torch.utils.data import distributed

sampler = distributed.DistributedSampler()