fastnlp / fastNLP

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

[bugfix]修复Tester初始化bug #401

Closed ouyhlan closed 2 years ago

ouyhlan commented 2 years ago

Description:修复Tester初始化bug

Main reason: core/tester.py里Tester类的初始化方法有一个很明显的bug https://github.com/fastnlp/fastNLP/blob/3cb01d15d8bc7d10f292b12e8fa803087d37e887/fastNLP/core/tester.py#L151 这里应该改为

            if _model_contains_inner_module(self._model):

因为 https://github.com/fastnlp/fastNLP/blob/3cb01d15d8bc7d10f292b12e8fa803087d37e887/fastNLP/core/tester.py#L111 且它上下文里其他部分: https://github.com/fastnlp/fastNLP/blob/3cb01d15d8bc7d10f292b12e8fa803087d37e887/fastNLP/core/tester.py#L135-L156 都用的是self._model

Checklist 检查下面各项是否完成

Please feel free to remove inapplicable items for your PR.

Changes:

Mention:

@yhcc