Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【Fix en docs】 Fix document formatting*test=document_fix #43996

Merged
merged 78 commits into from
Aug 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
41e7ce1
Update creation.py
ReganYue Jul 1, 2022
c40c576
Merge branch 'PaddlePaddle:develop' into ReganYue
ReganYue Jul 1, 2022
eea53b4
【Fix en docs】 Fix document formatting
ReganYue Jul 1, 2022
c8b12ae
Merge branch 'ReganYue' of https://github.com/ReganYue/Paddle into Re…
ReganYue Jul 1, 2022
f3b6766
修复格式,解决中英文文档不一致问题
ReganYue Jul 1, 2022
9818434
Merge branch 'PaddlePaddle:develop' into ReganYue
ReganYue Jul 1, 2022
9ecd895
fix大量 与 Return Type 和 Return相关的文档
ReganYue Jul 1, 2022
a7e1af3
Merge branch 'ReganYue' of https://github.com/ReganYue/Paddle into Re…
ReganYue Jul 1, 2022
e1c2b51
Convert Variable and LoDTensor to Tensor
ReganYue Jul 1, 2022
3fd7924
Update python/paddle/nn/functional/common.py
ReganYue Jul 24, 2022
55c3e4c
Update detection.py
ReganYue Jul 24, 2022
5bff1a3
Update io.py
ReganYue Jul 24, 2022
3818774
Update io.py
ReganYue Jul 24, 2022
09d95d7
Update loss.py
ReganYue Jul 24, 2022
4c58a08
Update loss.py
ReganYue Jul 24, 2022
d484121
Update io.py
ReganYue Jul 24, 2022
a7884c1
Update io.py
ReganYue Jul 24, 2022
783fba7
Update nn.py
ReganYue Jul 24, 2022
254de68
Update nn.py
ReganYue Jul 24, 2022
59f9c1a
Update nn.py
ReganYue Jul 24, 2022
f75cb29
Update nn.py
ReganYue Jul 24, 2022
0808533
Update nn.py
ReganYue Jul 24, 2022
98e76c5
Update nn.py
ReganYue Jul 24, 2022
f0be690
Update nn.py
ReganYue Jul 24, 2022
87a924f
Update nn.py
ReganYue Jul 24, 2022
5400535
Update nn.py
ReganYue Jul 24, 2022
3422494
Update nn.py
ReganYue Jul 24, 2022
1c01c98
Update sequence_lod.py
ReganYue Jul 24, 2022
c2810c8
Update sequence_lod.py
ReganYue Jul 24, 2022
a3485dc
Update sequence_lod.py
ReganYue Jul 24, 2022
522f008
Update sequence_lod.py
ReganYue Jul 24, 2022
5ed9e92
Update sequence_lod.py
ReganYue Jul 24, 2022
c929a00
Update sequence_lod.py
ReganYue Jul 24, 2022
8a7b5dc
Update sequence_lod.py
ReganYue Jul 24, 2022
3d70a9e
Update sequence_lod.py
ReganYue Jul 24, 2022
29857c1
Update sequence_lod.py
ReganYue Jul 24, 2022
6211d77
Update sequence_lod.py
ReganYue Jul 24, 2022
69a05d7
Update sequence_lod.py
ReganYue Jul 24, 2022
29e062b
Update metrics.py
ReganYue Jul 24, 2022
cb9dae2
Update metrics.py
ReganYue Jul 24, 2022
12480d0
Update metrics.py
ReganYue Jul 24, 2022
933355e
Update metrics.py
ReganYue Jul 24, 2022
e32ceff
Update metrics.py
ReganYue Jul 24, 2022
12e73cb
Update nets.py
ReganYue Jul 24, 2022
2b62d34
Update reader.py
ReganYue Jul 24, 2022
66f1047
Merge branch 'PaddlePaddle:develop' into ReganYue
ReganYue Jul 24, 2022
0a4d65f
Update nn.py
ReganYue Jul 24, 2022
bbf9a5d
Merge branch 'ReganYue' of https://github.com/ReganYue/Paddle into Re…
ReganYue Jul 24, 2022
74e075f
Update io.py
ReganYue Jul 29, 2022
5b287e2
Update nn.py
ReganYue Jul 29, 2022
8923242
Update io.py
ReganYue Jul 29, 2022
6e83aaa
remove Return Type to Returns
ReganYue Jul 29, 2022
ac9ce53
Update sequence_lod.py
ReganYue Jul 29, 2022
0be8fb3
Update sequence_lod.py
ReganYue Jul 29, 2022
3116539
Update common.py
ReganYue Jul 29, 2022
e689871
Update common.py
ReganYue Jul 29, 2022
2e4fb97
Update extension.py
ReganYue Jul 29, 2022
4aaef33
Update creation.py
ReganYue Jul 29, 2022
be06ca1
update*test=document_fix
ReganYue Jul 29, 2022
97a9577
Update io.py
ReganYue Aug 3, 2022
43a0886
Update manipulation.py
ReganYue Aug 3, 2022
e595b19
Update sequence_lod.py
ReganYue Aug 3, 2022
4521b94
Update common.py
ReganYue Aug 3, 2022
6d3b3ac
Update common.py
ReganYue Aug 3, 2022
f3fe88c
Update common.py
ReganYue Aug 3, 2022
8cab350
Update common.py
ReganYue Aug 3, 2022
c52af3c
update*test=document_fix
ReganYue Aug 3, 2022
dd8fa2a
update*test=document_fix
ReganYue Aug 3, 2022
b311989
Update loss.py
ReganYue Aug 3, 2022
88cbd55
Update loss.py
ReganYue Aug 3, 2022
0b9c29f
update*test=document_fix
ReganYue Aug 3, 2022
eeda1a8
paddle.crop
Ligoml Aug 3, 2022
0b8dc46
for ci;test=document_fix
Ligoml Aug 3, 2022
43d585e
update io;test=document_fix
Ligoml Aug 3, 2022
3a04dca
Update io.py
Ligoml Aug 4, 2022
b38b3bf
update sequence_expand docs;test=document_fix
Ligoml Aug 4, 2022
564b4cd
Merge branch 'PaddlePaddle:develop' into ReganYue
ReganYue Aug 4, 2022
a10e413
update note typos;test=document_fix
Ligoml Aug 4, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 5 additions & 39 deletions python/paddle/fluid/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,6 @@ def is_belong_to_optimizer(var):
@dygraph_not_support
def get_program_parameter(program):
"""
:api_attr: Static Graph

Get all the parameters from Program.

Args:
Expand All @@ -212,8 +210,6 @@ def get_program_parameter(program):
@dygraph_not_support
def get_program_persistable_vars(program):
"""
:api_attr: Static Graph

Get all the persistable vars from Program.

Args:
Expand Down Expand Up @@ -292,9 +288,7 @@ def save_vars(executor,
predicate=None,
filename=None):
"""
:api_attr: Static Graph

This API saves specific variables in the `Program` to files.
Save specific variables in the `Program` to files.

There are two ways to specify the variables to be saved: set variables in
a list and assign it to the `vars`, or use the `predicate` function to select
Expand Down Expand Up @@ -436,9 +430,7 @@ def name_has_fc(var):
@dygraph_not_support
def save_params(executor, dirname, main_program=None, filename=None):
"""
:api_attr: Static Graph

This operator saves all parameters from the :code:`main_program` to
Save all parameters from the :code:`main_program` to
the folder :code:`dirname` or file :code:`filename`. You can refer to
:ref:`api_guide_model_save_reader_en` for more details.

Expand Down Expand Up @@ -670,9 +662,7 @@ def is_valid(var):
@dygraph_not_support
def save_persistables(executor, dirname, main_program=None, filename=None):
"""
:api_attr: Static Graph

This operator saves all persistable variables from :code:`main_program` to
Save all persistable variables from :code:`main_program` to
the folder :code:`dirname` or file :code:`filename`. You can refer to
:ref:`api_guide_model_save_reader_en` for more details. And then
saves these persistables variables to the folder :code:`dirname` or file
Expand Down Expand Up @@ -780,9 +770,6 @@ def load_vars(executor,
Returns:
None

Raises:
TypeError: If `main_program` is not an instance of Program nor None.

Examples:
.. code-block:: python

Expand Down Expand Up @@ -1247,8 +1234,6 @@ def save_inference_model(dirname,
program_only=False,
clip_extra=False):
"""
:api_attr: Static Graph

Prune the given `main_program` to build a new program especially for inference,
and then save it and all related parameters to given `dirname` .
If you just want to save parameters of your trained model, please use the
Expand Down Expand Up @@ -1279,7 +1264,7 @@ def save_inference_model(dirname,
params_filename(str, optional): The name of file to save all related parameters.
If it is set None, parameters will be saved
in separate files .
export_for_deployment(bool): If True, programs are modified to only support
export_for_deployment(bool, optional): If True, programs are modified to only support
direct inference deployment. Otherwise,
more information will be stored for flexible
optimization and re-training. Currently, only
Expand All @@ -1290,14 +1275,7 @@ def save_inference_model(dirname,
Default: False.

Returns:
The fetch variables' name list

Return Type:
list

Raises:
ValueError: If `feed_var_names` is not a list of basestring, an exception is thrown.
ValueError: If `target_vars` is not a list of Variable, an exception is thrown.
list, The fetch variables' name list.

Examples:
.. code-block:: python
Expand Down Expand Up @@ -1462,8 +1440,6 @@ def load_inference_model(dirname,
params_filename=None,
pserver_endpoints=None):
"""
:api_attr: Static Graph

Load the inference model from a given directory. By this API, you can get the model
structure(Inference Program) and model parameters. If you just want to load
parameters of the pre-trained model, please use the :ref:`api_fluid_io_load_params` API.
Expand Down Expand Up @@ -1501,8 +1477,6 @@ def load_inference_model(dirname,
``Variable`` (refer to :ref:`api_guide_Program_en`). It contains variables from which
we can get inference results.

Raises:
ValueError: If `dirname` is not a existing directory.

Examples:
.. code-block:: python
Expand Down Expand Up @@ -1659,12 +1633,6 @@ def get_parameter_value_by_name(name, executor, program=None):
Returns:
numpy.array: The parameter's values.

Raises:
TypeError: If given `name` is not an instance of basestring.
TypeError: If the parameter with the given name doesn't exist.
AssertionError: If there is a variable named `name` in the
given program but it is not a Parameter.

Examples:
.. code-block:: python

Expand Down Expand Up @@ -2314,8 +2282,6 @@ def _load_vars_with_try_catch(exe,
@static_only
def set_program_state(program, state_dict):
"""
:api_attr: Static Graph

Set program parameter from state_dict

An exception will throw if shape or dtype of the parameters is not match.
Expand Down
8 changes: 3 additions & 5 deletions python/paddle/fluid/layers/loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ def cross_entropy2(input, label, ignore_index=kIgnoreIndex):
def square_error_cost(input, label):
r"""

This op accepts input predictions and target label and returns the
Accept input predictions and target label and returns the
squared error cost.

For predictions label, and target label, the equation is:
Expand All @@ -325,10 +325,8 @@ def square_error_cost(input, label):
label (Tensor): Label tensor, the data type should be float32.

Returns:
The tensor storing the element-wise squared error \
difference between input and label.

Return type: Tensor.
Tensor, The tensor storing the element-wise squared
error difference between input and label.

Examples:

Expand Down
23 changes: 7 additions & 16 deletions python/paddle/fluid/layers/nn.py
Original file line number Diff line number Diff line change
Expand Up @@ -9359,14 +9359,14 @@ def crop(x, shape=None, offsets=None, name=None):

Parameters:
x (Variable): Tensor, data type can be float32 or float64.
shape (Variable|list/tuple of integers): The output shape is specified
shape (Variable|list/tuple of integers, optional): The output shape is specified
by `shape`, which can be a Tensor or a list/tuple of integers.
If it is a Tensor, it's rank must be the same as `x` , only
it's shape will be used, and the value of it will be ignored. This way
is suitable for the case that the output shape may be changed each
iteration. If it is a list/tuple of integers, it's length must be the same
as the rank of `x`
offsets (Variable|list/tuple of integers|None): Specifies the cropping
offsets (Variable|list/tuple of integers|None, optional): Specifies the cropping
offsets at each dimension. It can be a Tensor or a list/tuple
of integers. If it is a Tensor, it's rank must be the same as `x`.
This way is suitable for the case that the offsets may be changed
Expand All @@ -9377,13 +9377,7 @@ def crop(x, shape=None, offsets=None, name=None):
None by default.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

shape应该是可选参数吧?另外paddle.crop的中文文档可能也有点问题?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


Returns:
The cropped Tensor, which has the same rank and data type with `x`

Return Type:
Variable

Raises:
ValueError: If shape is not a list, tuple or Variable.
Tensor, The cropped Tensor, which has the same rank and data type with `x`.

Examples:

Expand Down Expand Up @@ -9721,7 +9715,8 @@ def pad2d(input,
name (str, optional) : The default value is None. Normally there is no need for
user to set this property. For more information, please refer to :ref:`api_guide_Name` .

Returns: Tensor, a 4-D Tensor padded according to paddings and mode and data type is same as input.
Returns:
Tensor, a 4-D Tensor padded according to paddings and mode and data type is same as input.

Examples:
.. code-block:: text
Expand Down Expand Up @@ -13282,14 +13277,10 @@ def space_to_depth(x, blocksize, name=None):
to :ref:`api_guide_Name`. Usually name is no need to set and \
None by default.

Returns: The output, which should be 4 dims Tensor or LodTensor, with the shape \
Returns:
Tensor, The output, which should be 4 dims Tensor or LodTensor, with the shape \
[batch, channel * blocksize * blocksize, height/blocksize, width/blocksize]

Return Type: Variable

Raises:
TypeError: blocksize type must be int64.

Examples:
.. code-block:: python

Expand Down
Loading