Describe the bug
当device不为cpu时,使用elmo_embedding时发生错误:
File "fastNLP/fastNLP/embeddings/elmo_embedding.py", line 329, in forward
token_embedding = token_embedding.masked_fill(mask, 0)
RuntimeError: expected self and mask to be on the same device, but got mask on cpu and self on cuda:0
To Reproduce
在使用Trainer,设置device不为cpu进行训练时,model含有elmo_embedding。
Describe the bug 当device不为cpu时,使用elmo_embedding时发生错误: File "fastNLP/fastNLP/embeddings/elmo_embedding.py", line 329, in forward token_embedding = token_embedding.masked_fill(mask, 0) RuntimeError: expected self and mask to be on the same device, but got mask on cpu and self on cuda:0
To Reproduce 在使用Trainer,设置device不为cpu进行训练时,model含有elmo_embedding。
Expected behavior 正常运行
相关环境 fastNLP=0.6.0或fastNLP=0.7.0