Skip to content

Commit d478006

Browse files
authored
fix: multiple typos (intializers→initializers, intput→input, etc.) (#7620)
1 parent 4cd82db commit d478006

File tree

10 files changed

+47
-50
lines changed

10 files changed

+47
-50
lines changed

_typos.toml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,6 @@ Optimzier = "Optimzier"
3535
Setment = "Setment"
3636
Simle = "Simle"
3737
Sovler = "Sovler"
38-
inferface = "inferface"
39-
infor = "infor"
40-
instert = "instert"
41-
instrinsics = "instrinsics"
42-
interchangable = "interchangable"
43-
intializers = "intializers"
44-
intput = "intput"
4538
libary = "libary"
4639
matrics = "matrics"
4740
metrices = "metrices"

ci_scripts/CAPItools/utils_helper.py

Lines changed: 38 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ def decode(self):
219219
# 避免空函数解析
220220
self.init_func = self.class_name
221221

222-
self.functions_infor = []
222+
self.functions_info = []
223223
# Note: 未来可能在private也有函数
224224
# Note: 函数内构造函数可能解析有问题,需要后期查验
225225
self.class_function_number = len(self.class_dict["methods"]["public"])
@@ -267,7 +267,7 @@ def decode(self):
267267
"param_intro"
268268
][param_name]
269269

270-
self.functions_infor.append(
270+
self.functions_info.append(
271271
{
272272
"name": function_name,
273273
"doxygen": funcs_intro,
@@ -322,46 +322,48 @@ def create_and_write_file_cn(self, save_dir, language):
322322
)
323323
f.write(class_function_head_text)
324324

325-
for fun_infor in self.functions_infor:
326-
if fun_infor["template"] == "":
325+
for fun_info in self.functions_info:
326+
if fun_info["template"] == "":
327327
fun_name_and_intro_text = ""
328328
else:
329-
fun_name_and_intro_text = f"{fun_infor['template']}\n"
329+
fun_name_and_intro_text = f"{fun_info['template']}\n"
330330
fun_name_and_intro_text += (
331-
f"{fun_infor['name']}\n"
331+
f"{fun_info['name']}\n"
332332
+ "'''''''''''\n"
333-
+ f"{fun_infor['doxygen']}\n"
333+
+ f"{fun_info['doxygen']}\n"
334334
+ "\n"
335335
)
336336
f.write(fun_name_and_intro_text)
337337

338-
if fun_infor["note"] != "":
338+
if fun_info["note"] != "":
339339
fun_note_text = (
340-
"..note::\n" + f"\t{fun_infor['note']}\n" + "\n"
340+
"..note::\n" + f"\t{fun_info['note']}\n" + "\n"
341341
)
342342
f.write(fun_note_text)
343343

344-
if len(fun_infor["parameter"]) != 0:
344+
if len(fun_info["parameter"]) != 0:
345345
parameters_text = "**参数**\n" + "'''''''''''\n"
346346
f.write(parameters_text)
347-
for param in fun_infor["parameter"].keys():
347+
for param in fun_info["parameter"].keys():
348348
param_text = f"\t- **{param}**"
349-
if fun_infor["parameter"][param]["type"] != "":
350-
param_text += f" ({fun_infor['parameter'][param]['type']})"
351-
if fun_infor["parameter"][param]["intro"] != "":
352-
param_text += f" - {fun_infor['parameter'][param]['intro']}"
349+
if fun_info["parameter"][param]["type"] != "":
350+
param_text += (
351+
f" ({fun_info['parameter'][param]['type']})"
352+
)
353+
if fun_info["parameter"][param]["intro"] != "":
354+
param_text += f" - {fun_info['parameter'][param]['intro']}"
353355
param_text += "\n"
354356
f.write(param_text)
355357
f.write("\n")
356358

357359
if (
358-
fun_infor["returns"] != ""
359-
and "void" not in fun_infor["returns"]
360+
fun_info["returns"] != ""
361+
and "void" not in fun_info["returns"]
360362
):
361363
fun_return_text = (
362364
"**返回**\n"
363365
+ "'''''''''''\n"
364-
+ f"{fun_infor['returns']}\n"
366+
+ f"{fun_info['returns']}\n"
365367
+ "\n"
366368
)
367369
f.write(fun_return_text)
@@ -399,46 +401,48 @@ def create_and_write_file_en(self, save_dir, language):
399401
)
400402
f.write(class_function_head_text)
401403

402-
for fun_infor in self.functions_infor:
403-
if fun_infor["template"] == "":
404+
for fun_info in self.functions_info:
405+
if fun_info["template"] == "":
404406
fun_name_and_intro_text = ""
405407
else:
406-
fun_name_and_intro_text = f"{fun_infor['template']}\n"
408+
fun_name_and_intro_text = f"{fun_info['template']}\n"
407409
fun_name_and_intro_text += (
408-
f"{fun_infor['name']}\n"
410+
f"{fun_info['name']}\n"
409411
+ "'''''''''''\n"
410-
+ f"{fun_infor['doxygen']}\n"
412+
+ f"{fun_info['doxygen']}\n"
411413
+ "\n"
412414
)
413415
f.write(fun_name_and_intro_text)
414416

415-
if fun_infor["note"] != "":
417+
if fun_info["note"] != "":
416418
fun_note_text = (
417-
"..note::\n" + f"\t{fun_infor['note']}\n" + "\n"
419+
"..note::\n" + f"\t{fun_info['note']}\n" + "\n"
418420
)
419421
f.write(fun_note_text)
420422

421-
if len(fun_infor["parameter"]) != 0:
423+
if len(fun_info["parameter"]) != 0:
422424
parameters_text = "**Parameters**\n" + "'''''''''''\n"
423425
f.write(parameters_text)
424-
for param in fun_infor["parameter"].keys():
426+
for param in fun_info["parameter"].keys():
425427
param_text = f"\t- **{param}**"
426-
if fun_infor["parameter"][param]["type"] != "":
427-
param_text += f" ({fun_infor['parameter'][param]['type']})"
428-
if fun_infor["parameter"][param]["intro"] != "":
429-
param_text += f" - {fun_infor['parameter'][param]['intro']}"
428+
if fun_info["parameter"][param]["type"] != "":
429+
param_text += (
430+
f" ({fun_info['parameter'][param]['type']})"
431+
)
432+
if fun_info["parameter"][param]["intro"] != "":
433+
param_text += f" - {fun_info['parameter'][param]['intro']}"
430434
param_text += "\n"
431435
f.write(param_text)
432436
f.write("\n")
433437

434438
if (
435-
fun_infor["returns"] != ""
436-
and "void" not in fun_infor["returns"]
439+
fun_info["returns"] != ""
440+
and "void" not in fun_info["returns"]
437441
):
438442
fun_return_text = (
439443
"**Returns**\n"
440444
+ "'''''''''''\n"
441-
+ f"{fun_infor['returns']}\n"
445+
+ f"{fun_info['returns']}\n"
442446
+ "\n"
443447
)
444448
f.write(fun_return_text)

docs/api/copy_codes_from_en_doc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ def find_codeblock_needed(cf_info):
237237
return None
238238

239239

240-
def instert_codes_into_cn_rst_if_need(cnrstfilename):
240+
def insert_codes_into_cn_rst_if_need(cnrstfilename):
241241
"""
242242
Analyse the cn rst file, if need, extract code-blocks from en docstring.
243243
"""
@@ -290,7 +290,7 @@ def instert_codes_into_cn_rst_if_need(cnrstfilename):
290290

291291

292292
def filter_all_files(
293-
rootdir, ext="_cn.rst", action=instert_codes_into_cn_rst_if_need
293+
rootdir, ext="_cn.rst", action=insert_codes_into_cn_rst_if_need
294294
):
295295
"""
296296
find all the _en.html file, and do the action.

docs/design/data_type/float16.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ To support the above features, two fundamental conversion functions are provided
9393
float16 float_to_half_rn(float f); // convert to half precision in round-to-nearest-even mode
9494
float half_to_float(float16 h);
9595
```
96-
which provides one-to-one conversion between float32 and float16. These twos functions will do different conversion routines based on the current hardware. CUDA/ARM instrinsics will be used when the corresponding hardware is available. If the hardware or compiler level does not support float32 to float16 conversion, software emulation will be performed to do the conversion.
96+
which provides one-to-one conversion between float32 and float16. These twos functions will do different conversion routines based on the current hardware. CUDA/ARM intrinsics will be used when the corresponding hardware is available. If the hardware or compiler level does not support float32 to float16 conversion, software emulation will be performed to do the conversion.
9797

9898
## float16 inference
9999
In Fluid, a neural network is represented as a protobuf message called [ProgramDesc](https://github.com/PaddlePaddle/docs/blob/develop/docs/design/concepts/program.md), whose Python wrapper is a [Program](https://github.com/PaddlePaddle/docs/blob/develop/docs/design/modules/python_api.md#program). The basic structure of a program is some nested [blocks](https://github.com/PaddlePaddle/docs/blob/develop/docs/design/modules/python_api.md#block), where each block consists of some [variable](https://github.com/PaddlePaddle/docs/blob/develop/docs/design/modules/python_api.md#variable) definitions and a sequence of [operators](https://github.com/PaddlePaddle/docs/blob/develop/docs/design/modules/python_api.md#operator). An [executor](https://github.com/PaddlePaddle/docs/blob/develop/docs/design/concepts/executor.md) will run a given program desc by executing the sequence of operators in the entrance block of the program one by one.

docs/design/modules/infer_var_type.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The variable type will be constant at runtime. Every variable's type can either
1010

1111
## Proposed Solution
1212

13-
The `InferVarType` is a compile-time function which is registered to each operator. The inferface of that function is:
13+
The `InferVarType` is a compile-time function which is registered to each operator. The interface of that function is:
1414

1515

1616
```c++

docs/design/others/graph.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ For each parameter, like W and b created by `layer.fc`, marked as double circles
5656

5757
## Block and Graph
5858

59-
The word block and graph are interchangable in the design of PaddlePaddle. A [Block](https://github.com/PaddlePaddle/Paddle/pull/3708) is a metaphor of the code and local variables in a pair of curly braces in programming languages, where operators are like statements or instructions. A graph of operators and variables is a representation of the block.
59+
The word block and graph are interchangeable in the design of PaddlePaddle. A [Block](https://github.com/PaddlePaddle/Paddle/pull/3708) is a metaphor of the code and local variables in a pair of curly braces in programming languages, where operators are like statements or instructions. A graph of operators and variables is a representation of the block.
6060

6161
A Block keeps operators in an array `BlockDesc::ops`
6262

docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.FractionalMaxPool2d.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ PyTorch 参数更多,具体如下:
2424
### 转写示例
2525
#### output_ratio:目标输出比例
2626
```python
27-
# 假设 intput 的 with=7, height=7,
27+
# 假设 input 的 with=7, height=7,
2828
# output_ratio = 0.75, 则目标 output 的 width = int(7*0.75) = 5, height = int(7*0.75) = 5
2929
# Pytorch 写法
3030
torch.nn.FractionalMaxPool2d(2, output_ratio=[0.75, 0.75], return_indices=True)

docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.FractionalMaxPool3d.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ PyTorch 参数更多,具体如下:
2424
### 转写示例
2525
#### output_ratio:目标输出比例
2626
```python
27-
# 假设 intput 的 depth=7, with=7, height=7,
27+
# 假设 input 的 depth=7, with=7, height=7,
2828
# output_ratio = 0.75, 则目标 output 的 depth = int(7*0.75) = 5, width = int(7*0.75) = 5, height = int(7*0.75) = 5
2929
# Pytorch 写法
3030
torch.nn.FractionalMaxPool3d(2, output_ratio=[0.75, 0.75, 0.75], return_indices=True)

docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.fractional_max_pool2d.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ PyTorch 参数更多,具体如下:
2525
### 转写示例
2626
#### output_ratio:目标输出比例
2727
```python
28-
# 假设 intput 的 with=7, height=7,
28+
# 假设 input 的 with=7, height=7,
2929
# output_ratio = 0.75, 则目标 output 的 width = int(7*0.75) = 5, height = int(7*0.75) = 5
3030
# Pytorch 写法
3131
torch.nn.functional.fractional_max_pool2d(input, 2, output_ratio=[0.75, 0.75], return_indices=True)

docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.fractional_max_pool3d.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ PyTorch 参数更多,具体如下:
2525
### 转写示例
2626
#### output_ratio:目标输出比例
2727
```python
28-
# 假设 intput 的 depth=7, with=7, height=7,
28+
# 假设 input 的 depth=7, with=7, height=7,
2929
# output_ratio = 0.75, 则目标 output 的 depth = int(7*0.75) = 5, width = int(7*0.75) = 5, height = int(7*0.75) = 5
3030
# Pytorch 写法
3131
torch.nn.functional.fractional_max_pool3d(input, 2, output_ratio=[0.75, 0.75, 0.75], return_indices=True)

0 commit comments

Comments
 (0)