Skip to content

Commit

Permalink
[CodeStyle][B004] hasattr replace callable (PaddlePaddle#52096)
Browse files Browse the repository at this point in the history
  • Loading branch information
gouzil authored Mar 28, 2023
1 parent e492ee2 commit 4118ab8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ select = [
# Bugbear
"B002",
"B003",
# "B004",
"B004",
# "B005",
# "B006",
# "B007",
Expand Down
2 changes: 1 addition & 1 deletion python/paddle/jit/dy2static/convert_call_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def dyfunc(x):
# 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):
Expand Down

0 comments on commit 4118ab8

Please sign in to comment.