From d2cc93cd6d949d9ef8327004233bd545cb3ca9b8 Mon Sep 17 00:00:00 2001 From: ChenXin Date: Mon, 16 Mar 2020 11:34:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8=20callable=20=E6=9B=BF?= =?UTF-8?q?=E4=BB=A3=20isfunction?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fastNLP/core/dataset.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fastNLP/core/dataset.py b/fastNLP/core/dataset.py index 5025edfe..273e2658 100644 --- a/fastNLP/core/dataset.py +++ b/fastNLP/core/dataset.py @@ -288,7 +288,6 @@ __all__ = [ ] import _pickle as pickle -from inspect import isfunction from copy import deepcopy import numpy as np @@ -874,7 +873,7 @@ class DataSet(object): :return Dict[int:Field]: 返回一个字典 """ # 返回 dict , 检查是否一直相同 - assert isfunction(func), "The func you provide is not callable." + assert callable(func), "The func you provide is not callable." assert len(self) != 0, "Null DataSet cannot use apply()." idx = -1 try: