Browse Source

使用 callable 替代 isfunction

tags/v0.5.5
ChenXin 4 years ago
parent
commit
918a413784
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      fastNLP/core/dataset.py

+ 1
- 1
fastNLP/core/dataset.py View File

@@ -925,7 +925,7 @@ class DataSet(object):
:return List[Any]: 里面的元素为func的返回值,所以list长度为DataSet的长度 :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()." assert len(self) != 0, "Null DataSet cannot use apply()."
idx = -1 idx = -1
try: try:


Loading…
Cancel
Save