RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu on transormer

后端 未结 0 2046
半阙折子戏
半阙折子戏 2021-01-23 19:19

def nopeak_mask(size, opt):
    np_mask = np.triu(np.ones((1, size, size)),k=1).astype(\'uint8\')
    np_mask =Variable(torch.from_numpy(np_mask) == 0)
    if opt.devic         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题