Skip to content

Commit a699f70

Browse files
authored
Merge branch 'develop' into typo-S
2 parents f5d3c3a + 6529481 commit a699f70

20 files changed

+50
-43
lines changed

_typos.toml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,7 @@ setted = "setted"
3232
shoule = "shoule"
3333
similary = "similary"
3434
simplier = "simplier"
35-
skiped = "skiped"
3635
softwares = "softwares"
37-
specail = "specail"
38-
splited = "splited"
36+
sperated = "sperated"
3937
splitted = "splitted"
40-
stirng = "stirng"
41-
stradegy = "stradegy"
42-
subract = "subract"
43-
sucess = "sucess"
44-
sucessor = "sucessor"
45-
sucessors = "sucessors"
4638
szie = "szie"

ci_scripts/check_api_cn.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function filter_cn_api_files() {
1515
local __resultvar=$2
1616
local need_check_files=""
1717
for file in `echo $git_files`;do
18-
grep 'code-block:: python' ../docs/$file > /dev/null
18+
grep -E 'code-block:: (python|pycon)' ../docs/$file > /dev/null
1919
if [ $? -eq 0 ] ;then
2020
api_file=`echo $file | sed 's#api/##g'`
2121
grep -w "${api_file}" ${DIR_PATH}/api_white_list.txt > /dev/null

ci_scripts/check_api_parameters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def check_api_parameters(rstfiles, apiinfo):
190190
"""check function's parameters same as its origin definition.
191191
192192
TODO:
193-
1. All the documents of classes are skiped now. As
193+
1. All the documents of classes are skipped now. As
194194
(1) there ars many class methods in documents, may break the scripts.
195195
(2) parameters of Class should be checked with its `__init__` method.
196196
2. Some COMPLICATED annotations may break the scripts.

docs/api/copy_codes_from_en_doc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def extract_code_blocks_from_docstr(docstr, google_style=True):
105105

106106
lastlineindex = len(docstr_list) - 1
107107

108-
cb_start_pat = re.compile(r"code-block::\s*python")
108+
cb_start_pat = re.compile(r"code-block::\s*(python|python-console|pycon)")
109109
cb_param_pat = re.compile(r"^\s*:(\w+):\s*(\S*)\s*$")
110110

111111
cb_info = {}
@@ -261,7 +261,7 @@ def insert_codes_into_cn_rst_if_need(cnrstfilename):
261261
cb_new = []
262262
indent = cf_info["indent"]
263263
cb_new.append("") # insert a empty line in the frontend
264-
cb_new.append(" " * indent + ".. code-block:: python")
264+
cb_new.append(" " * indent + ".. code-block:: pycon")
265265
if cf_info["cb_name"]:
266266
cb_new.append(" " * (indent + 3) + ":name: " + cf_info["cb_name"])
267267
cb_new.append("")

docs/api/extract_api_from_docs.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ def extract_code_blocks_from_rst(docstr):
5555
ds_list = docstr.expandtabs(tabsize=4).split("\n")
5656
lastlineindex = len(ds_list) - 1
5757
cb_started = False
58-
cb_start_pat = re.compile(r"((code)|(code-block))::\s*i?python[23]?")
58+
cb_start_pat = re.compile(
59+
r"((code)|(code-block))::\s*i?(python|python-console|pycon)"
60+
)
5961
cb_cur = []
6062
cb_cur_indent = -1
6163
for lineno, linecont in enumerate(ds_list):

docs/api/gen_doc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@ def parse_module_file(mod):
262262
return
263263
logger.debug("parsing %s:%s", mod_name, src_file)
264264
if len(mod_name) >= 6 and mod_name[:6] == "paddle":
265-
fn_splited = os.path.splitext(src_file)
266-
if len(fn_splited) > 1 and fn_splited[1].lower() == ".py":
265+
fn_split = os.path.splitext(src_file)
266+
if len(fn_split) > 1 and fn_split[1].lower() == ".py":
267267
mod_ast = ast.parse(open(src_file, "r").read())
268268
for node in mod_ast.body:
269269
short_names = []

docs/api/paddle/cosh_cn.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
cosh
44
-------------------------------
55

6-
.. py:function:: paddle.cosh(x, name=None)
6+
.. py:function:: paddle.cosh(x, name=None, *, out=None)
77
88
99
@@ -21,6 +21,7 @@ cosh
2121

2222
- **x** (Tensor) - 输入的 Tensor,数据类型为:float32、float64 、float16、complex64、complex128。
2323
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。
24+
- **out** (Tensor,可选)- 输出的结果。该参数为仅关键字参数,默认值为 None。
2425

2526
返回
2627
::::::::::::

docs/api/paddle/device/memory_allocated_cn.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ memory_allocated
2222

2323
代码示例
2424
::::::::::::
25-
.. code-block:: python
25+
.. code-block:: pycon
2626
2727
>>> import paddle
2828
>>> paddle.device.memory_allocated('npu:0')

docs/api/paddle/device/memory_reserved_cn.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ memory_reserved
1919

2020
代码示例
2121
::::::::::::
22-
.. code-block:: python
22+
.. code-block:: pycon
2323
2424
>>> import paddle
2525
>>> paddle.device.memory_reserved('npu:0')

docs/api/paddle/device/reset_max_memory_allocated_cn.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ reset_max_memory_allocated
1919

2020
代码示例
2121
::::::::::::
22-
.. code-block:: python
22+
.. code-block:: pycon
2323
2424
>>> import paddle
2525
>>> paddle.device.reset_max_memory_allocated('npu:0')

0 commit comments

Comments
 (0)