Skip to content

Commit a53c766

Browse files
committed
fix type of parameter
1 parent 8d5254e commit a53c766

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

python/paddle/jit/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from .api import load
1818
from .api import to_static
1919
from .api import not_to_static
20+
from .api import ignore_module
2021
from .dy2static.logging_utils import set_code_level, set_verbosity
2122

2223
from . import dy2static

python/paddle/jit/api.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
from collections import OrderedDict
2525
import inspect
2626
import threading
27-
from typing import Any
27+
from typing import Any, List
2828

2929
import paddle
3030
from paddle.fluid import core, dygraph
@@ -193,26 +193,26 @@ def copy_decorator_attrs(original_func, decorated_obj):
193193
return decorated_obj
194194

195195

196-
def ignore_module(modules: List):
196+
def ignore_module(modules: List[Any]):
197197
"""
198198
Adds modules that ignore transcription.
199199
Builtin modules that have been ignored are collections, pdb, copy, inspect, re, numpy, logging, six
200200
201201
Args:
202-
modules (list[]): Ignored modules that you want to add
202+
modules (List[Any]): Ignored modules that you want to add
203203
204204
Examples:
205205
.. code-block:: python
206206
207207
import scipy
208-
import pandas
208+
import astor
209209
210210
import paddle
211211
from paddle.jit import ignore_module
212212
213213
modules = [
214214
scipy,
215-
pandas
215+
astor
216216
]
217217
218218
ignore_module(modules)

python/paddle/jit/dy2static/convert_call_func.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import pdb
2222
import re
2323
import types
24-
from typing import List
24+
from typing import Any, List
2525

2626
import numpy
2727

@@ -101,7 +101,7 @@ def builtin_modules():
101101
BUILTIN_LIKELY_MODULES = builtin_modules()
102102

103103

104-
def add_ignore_module(modules: List):
104+
def add_ignore_module(modules: List[Any]):
105105
"""
106106
Adds modules that ignore transcription
107107
"""

0 commit comments

Comments
 (0)