From 918a413784053f489a49cb5a1dd211038cba521f Mon Sep 17 00:00:00 2001 From: ChenXin Date: Mon, 16 Mar 2020 11:50:15 +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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastNLP/core/dataset.py b/fastNLP/core/dataset.py index 273e2658..74c0023c 100644 --- a/fastNLP/core/dataset.py +++ b/fastNLP/core/dataset.py @@ -925,7 +925,7 @@ class DataSet(object): :return List[Any]: 里面的元素为func的返回值,所以list长度为DataSet的长度 """ - 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: