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

[Docathon] Fix en api_label #57711

Merged
merged 2 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion python/paddle/base/lod_tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ def create_lod_tensor(data, recursive_seq_lens, place):
would be converted to offset-based LoD [[0, 2, 5]] inside the function
call.

Please reference :ref:`user_guide_lod_tensor` for more details regarding LoD.

Args:
data (numpy.ndarray|list|LoDTensor): a numpy array, a list or ad LoDTensor
Expand Down
5 changes: 2 additions & 3 deletions python/paddle/jit/dy2static/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def data_layer_not_check(name, shape, dtype='float32', lod_level=0):
data can be various-length. This API is used in translating dygraph into
static graph.

Note:
Note:
The default :code:`stop_gradient` attribute of the Tensor created by
this API is true, which means the gradient won't be passed backward
through the data Tensor. Set :code:`var.stop_gradient = False` If
Expand All @@ -153,8 +153,7 @@ def data_layer_not_check(name, shape, dtype='float32', lod_level=0):
dtype: bool, float16, float32, float64, int8, int16, int32, int64,
uint8. Default: float32
lod_level (int, optional): The LoD level of the LoDTensor. Usually users
don't have to set this value. For more details about when and how to
use LoD level, see :ref:`user_guide_lod_tensor` . Default: 0
don't have to set this value. Default: 0

Returns:
Tensor: The global Tensor that gives access to the data.
Expand Down
6 changes: 3 additions & 3 deletions python/paddle/nn/functional/activation.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def hardtanh(x, min=-1.0, max=1.0, name=None):
def hardtanh_(x, min=-1.0, max=1.0, name=None):
r"""
Inplace version of ``hardtanh`` API, the output Tensor will be inplaced with input ``x``.
Please refer to :ref:`paddle_nn_functional_hardtanh`.
Please refer to :ref:`api_paddle_nn_functional_hardtanh`.
"""
if in_dynamic_mode():
return _C_ops.hardtanh_(x, min, max)
Expand Down Expand Up @@ -495,7 +495,7 @@ def leaky_relu(x, negative_slope=0.01, name=None):
def leaky_relu_(x, negative_slope=0.01, name=None):
r"""
Inplace version of ``leaky_relu`` API, the output Tensor will be inplaced with input ``x``.
Please refer to :ref:`paddle_nn_functional_leaky_relu`.
Please refer to :ref:`api_paddle_nn_functional_leaky_relu`.
"""
if in_dynamic_mode():
return _C_ops.leaky_relu_(x, negative_slope)
Expand Down Expand Up @@ -1594,7 +1594,7 @@ def thresholded_relu(x, threshold=1.0, name=None):
def thresholded_relu_(x, threshold=1.0, name=None):
r"""
Inplace version of ``thresholded_relu`` API, the output Tensor will be inplaced with input ``x``.
Please refer to :ref:`paddle_nn_functional_thresholded_relu`.
Please refer to :ref:`api_paddle_nn_functional_thresholded_relu`.
"""
if in_dynamic_mode():
return _C_ops.thresholded_relu_(x, threshold)
Expand Down
4 changes: 2 additions & 2 deletions python/paddle/nn/functional/vision.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ def grid_sample(
def pixel_shuffle(x, upscale_factor, data_format="NCHW", name=None):
"""
This API implements pixel shuffle operation.
See more details in :ref:`PixelSuffle <api_paddle_nn_PixelSuffle>` .
See more details in :ref:`PixelSuffle <api_paddle_nn_PixelShuffle>` .


Parameters:
Expand Down Expand Up @@ -392,7 +392,7 @@ def pixel_shuffle(x, upscale_factor, data_format="NCHW", name=None):
def pixel_unshuffle(x, downscale_factor, data_format="NCHW", name=None):
"""
This API implements pixel unshuffle operation.
See more details in :ref:`PixelUnSuffle <api_paddle_nn_PixelUnSuffle>` .
See more details in :ref:`PixelUnSuffle <api_paddle_nn_PixelUnshuffle>` .

Parameters:
x (Tensor): 4-D tensor, the data type should be float32 or float64.
Expand Down
4 changes: 2 additions & 2 deletions python/paddle/profiler/profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class ProfilerState(Enum):

class ProfilerTarget(Enum):
r"""
ProfilerTarget is used to specify target device for :ref:`profiling <api_paddle_profiler_Profiler>` . Only CPU, GPU and XPU are supported currently.
ProfilerTarget is used to specify target device for :ref:`Profiler <api_paddle_profiler_Profiler>` . Only CPU, GPU and XPU are supported currently.

The meaning of each ProfilerState is as following

Expand All @@ -123,7 +123,7 @@ def make_scheduler(
skip_first: int = 0,
) -> Callable:
r"""
Return a scheduler function, which scheduler the :ref:`state <api_paddle_profiler_ProfilerState>` according to the setting.
Return a scheduler function, which scheduler the :ref:`ProfilerState <api_paddle_profiler_ProfilerState>` according to the setting.
The state transform confirms to:

.. code-block:: text
Expand Down
2 changes: 1 addition & 1 deletion python/paddle/profiler/profiler_statistic.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

class SortedKeys(Enum):
r"""
SortedKeys is used to specify how to sort items when printing :ref:`summary <api_paddle_profiler_profiler_summary>` table.
SortedKeys is used to specify how to sort items when printing ``paddle.profiler.Profiler.summary`` table.

The meaning of each SortedKeys is as following

Expand Down
2 changes: 1 addition & 1 deletion python/paddle/static/nn/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1500,7 +1500,7 @@ def conv2d_transpose(
is not set, the parameter is initialized with Xavier. Default: None.
bias_attr (ParamAttr|bool, optional): Specifies the object for the bias parameter attribute.
The default value is None, which means that the default bias parameter attribute is used.
For detailed information, please refer to :ref:`paramattr`.
For detailed information, please refer to :ref:`api_paddle_ParamAttr`.
The default bias initialisation for the conv2d_transpose operator is 0.0.
use_cudnn(bool, optional): Use cudnn kernel or not, it is valid only when the cudnn
library is installed. Default: True.
Expand Down
6 changes: 3 additions & 3 deletions python/paddle/tensor/linalg.py
Original file line number Diff line number Diff line change
Expand Up @@ -2581,9 +2581,9 @@ def eig(x, name=None):
Performs the eigenvalue decomposition of a square matrix or a batch of square matrices.

Note:
- If the matrix is a Hermitian or a real symmetric matrix, please use :ref:`paddle.linalg.eigh` instead, which is much faster.
- If only eigenvalues is needed, please use :ref:`paddle.linalg.eigvals` instead.
- If the matrix is of any shape, please use :ref:`paddle.linalg.svd`.
- If the matrix is a Hermitian or a real symmetric matrix, please use :ref:`api_paddle_linalg_eigh` instead, which is much faster.
- If only eigenvalues is needed, please use :ref:`api_paddle_linalg_eigvals` instead.
- If the matrix is of any shape, please use :ref:`api_paddle_linalg_svd`.
- This API is only supported on CPU device.
- The output datatype is always complex for both real and complex input.

Expand Down
4 changes: 2 additions & 2 deletions python/paddle/vision/datasets/cifar.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class Cifar10(Dataset):
download (bool, optional): download dataset automatically if :attr:`data_file` is None. Default True.
backend (str, optional): Specifies which type of image to be returned:
PIL.Image or numpy.ndarray. Should be one of {'pil', 'cv2'}.
If this option is not set, will get backend from :ref:`paddle.vision.get_image_backend <api_vision_image_get_image_backend>`,
If this option is not set, will get backend from :ref:`paddle.vision.get_image_backend <api_paddle_vision_get_image_backend>`,
default backend is 'pil'. Default: None.

Returns:
Expand Down Expand Up @@ -198,7 +198,7 @@ class Cifar100(Cifar10):
download (bool, optional): download dataset automatically if :attr:`data_file` is None. Default True.
backend (str, optional): Specifies which type of image to be returned:
PIL.Image or numpy.ndarray. Should be one of {'pil', 'cv2'}.
If this option is not set, will get backend from :ref:`paddle.vision.get_image_backend <api_vision_image_get_image_backend>`,
If this option is not set, will get backend from :ref:`paddle.vision.get_image_backend <api_paddle_vision_get_image_backend>`,
default backend is 'pil'. Default: None.

Returns:
Expand Down
2 changes: 1 addition & 1 deletion python/paddle/vision/datasets/flowers.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class Flowers(Dataset):
download (bool, optional): download dataset automatically if :attr:`data_file` is None. Default: True.
backend (str, optional): Specifies which type of image to be returned:
PIL.Image or numpy.ndarray. Should be one of {'pil', 'cv2'}.
If this option is not set, will get backend from :ref:`paddle.vision.get_image_backend <api_vision_image_get_image_backend>`,
If this option is not set, will get backend from :ref:`paddle.vision.get_image_backend <api_paddle_vision_get_image_backend>`,
default backend is 'pil'. Default: None.

Returns:
Expand Down
4 changes: 2 additions & 2 deletions python/paddle/vision/datasets/mnist.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class MNIST(Dataset):
:attr:`image_path` :attr:`label_path` is not set. Default: True.
backend (str, optional): Specifies which type of image to be returned:
PIL.Image or numpy.ndarray. Should be one of {'pil', 'cv2'}.
If this option is not set, will get backend from :ref:`paddle.vision.get_image_backend <api_vision_image_get_image_backend>`,
If this option is not set, will get backend from :ref:`paddle.vision.get_image_backend <api_paddle_vision_get_image_backend>`,
default backend is 'pil'. Default: None.

Returns:
Expand Down Expand Up @@ -249,7 +249,7 @@ class FashionMNIST(MNIST):
:attr:`image_path` :attr:`label_path` is not set. Default: True.
backend (str, optional): Specifies which type of image to be returned:
PIL.Image or numpy.ndarray. Should be one of {'pil', 'cv2'}.
If this option is not set, will get backend from :ref:`paddle.vision.get_image_backend <api_vision_image_get_image_backend>`,
If this option is not set, will get backend from :ref:`paddle.vision.get_image_backend <api_paddle_vision_get_image_backend>`,
default backend is 'pil'. Default: None.

Returns:
Expand Down
2 changes: 1 addition & 1 deletion python/paddle/vision/datasets/voc2012.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class VOC2012(Dataset):
download (bool, optional): Download dataset automatically if :attr:`data_file` is None. Default: True.
backend (str, optional): Specifies which type of image to be returned:
PIL.Image or numpy.ndarray. Should be one of {'pil', 'cv2'}.
If this option is not set, will get backend from :ref:`paddle.vision.get_image_backend <api_vision_image_get_image_backend>`,
If this option is not set, will get backend from :ref:`paddle.vision.get_image_backend <api_paddle_vision_get_image_backend>`,
default backend is 'pil'. Default: None.

Returns:
Expand Down
10 changes: 5 additions & 5 deletions python/paddle/vision/models/densenet.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ def densenet121(pretrained=False, **kwargs):
Args:
pretrained (bool, optional): Whether to load pre-trained weights. If True, returns a model pre-trained
on ImageNet. Default: False.
**kwargs (optional): Additional keyword arguments. For details, please refer to :ref:`DenseNet <api_paddle_vision_DenseNet>`.
**kwargs (optional): Additional keyword arguments. For details, please refer to :ref:`DenseNet <api_paddle_vision_models_DenseNet>`.

Returns:
:ref:`api_paddle_nn_Layer`. An instance of DenseNet 121-layer model.
Expand Down Expand Up @@ -392,7 +392,7 @@ def densenet161(pretrained=False, **kwargs):
Args:
pretrained (bool, optional): Whether to load pre-trained weights. If True, returns a model pre-trained
on ImageNet. Default: False.
**kwargs (optional): Additional keyword arguments. For details, please refer to :ref:`DenseNet <api_paddle_vision_DenseNet>`.
**kwargs (optional): Additional keyword arguments. For details, please refer to :ref:`DenseNet <api_paddle_vision_models_DenseNet>`.

Returns:
:ref:`api_paddle_nn_Layer`. An instance of DenseNet 161-layer model.
Expand Down Expand Up @@ -425,7 +425,7 @@ def densenet169(pretrained=False, **kwargs):
Args:
pretrained (bool, optional): Whether to load pre-trained weights. If True, returns a model pre-trained
on ImageNet. Default: False.
**kwargs (optional): Additional keyword arguments. For details, please refer to :ref:`DenseNet <api_paddle_vision_DenseNet>`.
**kwargs (optional): Additional keyword arguments. For details, please refer to :ref:`DenseNet <api_paddle_vision_models_DenseNet>`.

Returns:
:ref:`api_paddle_nn_Layer`. An instance of DenseNet 169-layer model.
Expand Down Expand Up @@ -458,7 +458,7 @@ def densenet201(pretrained=False, **kwargs):
Args:
pretrained (bool, optional): Whether to load pre-trained weights. If True, returns a model pre-trained
on ImageNet. Default: False.
**kwargs (optional): Additional keyword arguments. For details, please refer to :ref:`DenseNet <api_paddle_vision_DenseNet>`.
**kwargs (optional): Additional keyword arguments. For details, please refer to :ref:`DenseNet <api_paddle_vision_models_DenseNet>`.

Returns:
:ref:`api_paddle_nn_Layer`. An instance of DenseNet 201-layer model.
Expand Down Expand Up @@ -490,7 +490,7 @@ def densenet264(pretrained=False, **kwargs):
Args:
pretrained (bool, optional): Whether to load pre-trained weights. If True, returns a model pre-trained
on ImageNet. Default: False.
**kwargs (optional): Additional keyword arguments. For details, please refer to :ref:`DenseNet <api_paddle_vision_DenseNet>`.
**kwargs (optional): Additional keyword arguments. For details, please refer to :ref:`DenseNet <api_paddle_vision_models_DenseNet>`.

Returns:
:ref:`api_paddle_nn_Layer`. An instance of DenseNet 264-layer model.
Expand Down
2 changes: 1 addition & 1 deletion python/paddle/vision/models/googlenet.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def googlenet(pretrained=False, **kwargs):
Args:
pretrained (bool, optional): Whether to load pre-trained weights. If True, returns a model pre-trained
on ImageNet. Default: False.
**kwargs (optional): Additional keyword arguments. For details, please refer to :ref:`GoogLeNet <api_paddle_vision_GoogLeNet>`.
**kwargs (optional): Additional keyword arguments. For details, please refer to :ref:`GoogLeNet <api_paddle_vision_models_GoogLeNet>`.
Copy link
Contributor

Choose a reason for hiding this comment

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

发现了一个问题,ref <api_label> 的时候,api_label是大小写不敏感的?比如 googlenet 这边引用 GoogLeNet,但最后官网生成的引用链接是 .../vision/models/googlenet_en.html#api-paddle-vision-models-googlenet 而不是 .../vision/models/GoogLeNet_en.html @SigureMo

http://preview-paddle-pr-57711.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/en/api/paddle/vision/models/googlenet_en.html

Copy link
Member

@SigureMo SigureMo Sep 26, 2023

Choose a reason for hiding this comment

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

这样的话,可能需要对重名的其中一个进行修改了

英文 label 生成见:

https://github.com/PaddlePaddle/docs/blob/f6e6e3a7ab17a06cac2862c4be5d81ca022ab6de/docs/api/gen_doc.py#L745-L747

这个比较类似文件大小写不敏感系统导致的重名问题,可以尝试一个类似的解决方案

中文可能需要同样的解决方案

或许和中文文件名一样使用 _upper 后缀即可,这样甚至中文那边逻辑不需要对 _upper 特判了


Returns:
:ref:`api_paddle_nn_Layer`. An instance of GoogLeNet (Inception v1) model.
Expand Down
2 changes: 1 addition & 1 deletion python/paddle/vision/models/inceptionv3.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ def inception_v3(pretrained=False, **kwargs):
Args:
pretrained (bool, optional): Whether to load pre-trained weights. If True, returns a model pre-trained
on ImageNet. Default: False.
**kwargs (optional): Additional keyword arguments. For details, please refer to :ref:`InceptionV3 <api_paddle_vision_InceptionV3>`.
**kwargs (optional): Additional keyword arguments. For details, please refer to :ref:`InceptionV3 <api_paddle_vision_models_InceptionV3>`.

Returns:
:ref:`api_paddle_nn_Layer`. An instance of Inception v3 model.
Expand Down
2 changes: 1 addition & 1 deletion python/paddle/vision/models/mobilenetv1.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ def mobilenet_v1(pretrained=False, scale=1.0, **kwargs):
pretrained (bool, optional): Whether to load pre-trained weights. If True, returns a model pre-trained
on ImageNet. Default: False.
scale (float, optional): Scale of channels in each layer. Default: 1.0.
**kwargs (optional): Additional keyword arguments. For details, please refer to :ref:`MobileNetV1 <api_paddle_vision_MobileNetV1>`.
**kwargs (optional): Additional keyword arguments. For details, please refer to :ref:`MobileNetV1 <api_paddle_vision_models_MobileNetV1>`.

Returns:
:ref:`api_paddle_nn_Layer`. An instance of MobileNetV1 model.
Expand Down
2 changes: 1 addition & 1 deletion python/paddle/vision/models/mobilenetv2.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def mobilenet_v2(pretrained=False, scale=1.0, **kwargs):
Args:
pretrained (bool, optional): Whether to load pre-trained weights. If True, returns a model pre-trained on ImageNet. Default: False.
scale (float, optional): Scale of channels in each layer. Default: 1.0.
**kwargs (optional): Additional keyword arguments. For details, please refer to :ref:`MobileNetV2 <api_paddle_vision_MobileNetV2>`.
**kwargs (optional): Additional keyword arguments. For details, please refer to :ref:`MobileNetV2 <api_paddle_vision_models_MobileNetV2>`.

Returns:
:ref:`api_paddle_nn_Layer`. An instance of MobileNetV2 model.
Expand Down
4 changes: 2 additions & 2 deletions python/paddle/vision/models/mobilenetv3.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ def mobilenet_v3_small(pretrained=False, scale=1.0, **kwargs):
Args:
pretrained (bool, optional): Whether to load pre-trained weights. If True, returns a model pre-trained on ImageNet. Default: False.
scale (float, optional): Scale of channels in each layer. Default: 1.0.
**kwargs (optional): Additional keyword arguments. For details, please refer to :ref:`MobileNetV3Small <api_paddle_vision_MobileNetV3Small>`.
**kwargs (optional): Additional keyword arguments. For details, please refer to :ref:`MobileNetV3Small <api_paddle_vision_models_MobileNetV3Small>`.

Returns:
:ref:`api_paddle_nn_Layer`. An instance of MobileNetV3 Small architecture model.
Expand Down Expand Up @@ -467,7 +467,7 @@ def mobilenet_v3_large(pretrained=False, scale=1.0, **kwargs):
Args:
pretrained (bool, optional): Whether to load pre-trained weights. If True, returns a model pre-trained on ImageNet. Default: False.
scale (float, optional): Scale of channels in each layer. Default: 1.0.
**kwargs (optional): Additional keyword arguments. For details, please refer to :ref:`MobileNetV3Large <api_paddle_vision_MobileNetV3Large>`.
**kwargs (optional): Additional keyword arguments. For details, please refer to :ref:`MobileNetV3Large <api_paddle_vision_models_MobileNetV3Large>`.

Returns:
:ref:`api_paddle_nn_Layer`. An instance of MobileNetV3 Large architecture model.
Expand Down
Loading