Here it is:

THCudaCheck FAIL file=/pytorch/torch/lib/THC/generic/THCTensorIndex.cu line=586 error=59 : device-side assert triggered
Traceback (most recent call last):
File “paragraphvec/train.py”, line 194, in 
fire.Fire()
File “/home/nejc/dev/paragraph-vectors/env/lib/python3.5/site-packages/fire/core.py”, line 127, in Fire
component_trace = _Fire(component, args, context, name)
File “/home/nejc/dev/paragraph-vectors/env/lib/python3.5/site-packages/fire/core.py”, line 366, in _Fire
component, remaining_args)
File “/home/nejc/dev/paragraph-vectors/env/lib/python3.5/site-packages/fire/core.py”, line 542, in _CallCallable
result = fn(*varargs, **kwargs)
File “paragraphvec/train.py”, line 94, in start
save_all)
File “paragraphvec/train.py”, line 141, in _run
batch.target_noise_ids)
File “/home/nejc/dev/paragraph-vectors/paragraphvec/models.py”, line 55, in forward
self._D[doc_ids, :], torch.sum(self._W[context_ids, :], dim=1))
File “/home/nejc/dev/paragraph-vectors/env/lib/python3.5/site-packages/torch/autograd/variable.py”, line 76, in getitem
return Index.apply(self, key)
File “/home/nejc/dev/paragraph-vectors/env/lib/python3.5/site-packages/torch/autograd/_functions/tensor.py”, line 16, in forward
result = i.index(ctx.index)
RuntimeError: cuda runtime error (59) : device-side assert triggered at /pytorch/torch/lib/THC/generic/THCTensorIndex.cu:586
terminate called after throwing an instance of 'std::runtime_error’
what():  cuda runtime error (59) : device-side assert triggered at /pytorch/torch/lib/THC/generic/THCStorage.c:182
Aborted (core dumped)

It is indeed a different line:
x = torch.add(self._D[doc_ids, :], torch.sum(self._W[context_ids, :], dim=1))
I’m still not sure why it only occurs on a GPU, but at least I have a starting point for debugging. Thanks.