未验证 提交 4118ab89 编写于 作者: G gouzil 提交者: GitHub

[CodeStyle][B004] hasattr replace callable (#52096)

上级 e492ee24
......@@ -89,7 +89,7 @@ select = [
# Bugbear
"B002",
"B003",
# "B004",
"B004",
# "B005",
# "B006",
# "B007",
......
......@@ -301,7 +301,7 @@ def convert_call(func):
# NOTE: func may have been decorated.
converted_call = None
elif hasattr(func, '__class__') and hasattr(func.__class__, '__call__'):
elif hasattr(func, '__class__') and callable(func.__class__):
from paddle.nn import Layer
if hasattr(func, 'forward') and isinstance(func, Layer):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册