fastnlp / fastNLP

fastNLP: A Modularized and Extensible NLP Framework. Currently still in incubation.
https://gitee.com/fastnlp/fastNLP
Apache License 2.0
3.05k stars 451 forks source link

Bugfix: fix lstm rnn.pack_padded_sequence RuntimeError: 提交到dev分支 #345

Closed johnson7788 closed 3 years ago

johnson7788 commented 3 years ago

Description:简要描述这次PR的内容 一个torch的bug: nn.utils.rnn.pack_padded_sequence: RuntimeError: 'lengths' argument should be a 1D CPU int64 tensor, but got 1D cuda:0 Long tensor 详情查看: https://github.com/pytorch/pytorch/issues/43227

Main reason: 做出这次修改的原因 兼容torch 1.70 GPU版本

Checklist 检查下面各项是否完成

Please feel free to remove inapplicable items for your PR.

Changes: 逐项描述修改的内容

Mention: 找人review你的PR

@修改过这个文件的人 @核心开发人员