token = torch.LongTensor(token)这行代码在CPU上正常跑,但是在gpu上跑时就报错,报的错是:typeError:an integer is required(got type torch.LongTensor)
然后我就把带把修改为token = torch.IntTensor(token).
但还是报错:typeError:an integer is required(got type torch.LongTensor
typeError:an integer is required(got type torch.LongTensor)
typeError:需要一个整数(获取torch.LongTensor类型)
你打印一下token的类型,看看是不是int类型