mirror of
https://gitee.com/fastnlp/fastNLP.git
synced 2024-11-29 18:59:01 +08:00
为 _TruncatedDataLoader 添加 __setattr__
This commit is contained in:
parent
c11c30a5fc
commit
d7ce92975c
@ -132,6 +132,10 @@ class _TruncatedDataLoader:
|
||||
def __getattr__(self, item):
|
||||
return getattr(self.dataloader, item)
|
||||
|
||||
def __setattr__(self, key, value):
|
||||
# 添加该函数使得在进行实验性训练或者评测时,用户对于 trainer.dataloader 的感觉和正常训练完全一样;
|
||||
setattr(self.dataloader, key, value)
|
||||
|
||||
|
||||
def check_evaluate_every(evaluate_every):
|
||||
r"""
|
||||
|
Loading…
Reference in New Issue
Block a user