Topk() error in cuda

Traceback (most recent call last):
  File "C:/project_py/OpenNMT-S_A_translation/", line 156, in <module>
  File "C:/project_py/OpenNMT-S_A_translation/", line 103, in main
    predBatch, predScore, goldScore, src = translator.translate(srcBatch, tgtBatch)
  File "C:\project_py\OpenNMT-S_A_translation\onmt\", line 286, in translate
    pred, predScore, goldScore = self.translateBatch(batch, srcBatch)
  File "C:\project_py\OpenNMT-S_A_translation\onmt\", line 255, in translateBatch
    is_done = beam[b].advance([b],b)
  File "C:\project_py\OpenNMT-S_A_translation\onmt\", line 78, in advance
    if self.nextYs[-1][0] == onmt.Constants.EOS:
RuntimeError: cuda runtime error (4) : unspecified launch failure at d:\pytorch\pytorch\torch\lib\thc\generic/THCStorage.c:36

I used the torch.topk() in two subfunctions of my program . The first subfunction can do well , while the other will happen to this bug . Who encountered this bug and has any solutions ?
Thanks in advance !

However the traceback didn’t show any problem about torch.topk()