Apparently an nn.Embedding layer is pushed to the wrong device.
Based on the posted code I cannot see where the issue might be, so could you try to narrow down the error by removing working parts of the code?
The loss_fct in the forward method might create issues, since you are pushing the pos_weight to the default device in:
loss_fct = nn.BCEWithLogitsLoss(pos_weight=pos_weight).cuda() 

Use .to(outputs.device) instead.