diff --git a/python/paddle/device/__init__.py b/python/paddle/device/__init__.py index d961fbfdda7f08846401731ac2041ef4e7bf3235..0673b36cbe5c52c6d3425f85785aa1bd9a22e2bb 100644 --- a/python/paddle/device/__init__.py +++ b/python/paddle/device/__init__.py @@ -53,7 +53,8 @@ def is_compiled_with_npu(): """ Whether paddle was built with WITH_ASCEND_CL=ON to support Ascend NPU. - Returns (bool): `True` if NPU is supported, otherwise `False`. + Return: + bool, ``True`` if NPU is supported, otherwise ``False``. Examples: .. code-block:: python diff --git a/python/paddle/device/cuda/__init__.py b/python/paddle/device/cuda/__init__.py index 22ef453d0859431f2eae7f2501f5f1db38b49c7b..188e334c2f1bafdfc3a3f34c435ea52e1372feee 100644 --- a/python/paddle/device/cuda/__init__.py +++ b/python/paddle/device/cuda/__init__.py @@ -208,7 +208,7 @@ def max_memory_allocated(device=None): For instance, a float32 tensor with shape [1] in GPU will take up 256 bytes memory, even though storing a float32 data requires only 4 bytes. Args: - device(paddle.CUDAPlace or int or str): The device, the id of the device or + device(paddle.CUDAPlace or int or str, optional): The device, the id of the device or the string name of device like 'gpu:x'. If device is None, the device is the current device. Default: None. @@ -239,7 +239,7 @@ def max_memory_reserved(device=None): Return the peak size of GPU memory that is held by the allocator of the given device. Args: - device(paddle.CUDAPlace or int or str): The device, the id of the device or + device(paddle.CUDAPlace or int or str, optional): The device, the id of the device or the string name of device like 'gpu:x'. If device is None, the device is the current device. Default: None. @@ -396,7 +396,7 @@ def get_device_properties(device=None): Return the properties of given device. Args: - device(paddle.CUDAPlace or int or str): The device, the id of the device or + device(paddle.CUDAPlace or int or str, optional): The device, the id of the device or the string name of device like 'gpu:x' which to get the properties of the device from. If device is None, the device is the current device. Default: None. diff --git a/python/paddle/nn/utils/weight_norm_hook.py b/python/paddle/nn/utils/weight_norm_hook.py index ca06bee40d764f27fca6923cb3f60a2904b2e55d..ae797a3f2bed0bc945382bd4eff0b721601881f3 100644 --- a/python/paddle/nn/utils/weight_norm_hook.py +++ b/python/paddle/nn/utils/weight_norm_hook.py @@ -170,9 +170,10 @@ def weight_norm(layer, name='weight', dim=0): Weight normalization is a reparameterization of the weight vectors in a neural network that decouples the magnitude of those weight vectors from their direction. Weight normalization - replaces the parameter specified by `name`(eg: 'weight') with two parameters: one parameter + replaces the parameter specified by ``name`` (eg: 'weight') with two parameters: one parameter specifying the magnitude (eg: 'weight_g') and one parameter specifying the direction (eg: 'weight_v'). Weight normalization has been implemented as discussed in this paper: + `Weight Normalization: A Simple Reparameterization to Accelerate Training of Deep Neural Networks `_. diff --git a/python/paddle/profiler/utils.py b/python/paddle/profiler/utils.py index e01add63e825eefdaf8f48eecd35543dfad7190e..2d9fe9480924f002ef3abeb405e86381dcbbaf89 100644 --- a/python/paddle/profiler/utils.py +++ b/python/paddle/profiler/utils.py @@ -63,7 +63,7 @@ class RecordEvent(ContextDecorator): result = data1 + data2 record_event.end() - **Note**: + Note: RecordEvent will take effect only when :ref:`Profiler ` is on and at the state of `RECORD`. """ diff --git a/python/paddle/utils/dlpack.py b/python/paddle/utils/dlpack.py index beb37be4530fd3b356c44eb94218f5507c206f3d..af4f9fe6c95b599da929037cdc97d5aff717ff7f 100644 --- a/python/paddle/utils/dlpack.py +++ b/python/paddle/utils/dlpack.py @@ -69,7 +69,7 @@ def from_dlpack(dlpack): dlpack (PyCapsule): a PyCapsule object with the dltensor. Returns: - out (Tensor): a tensor decoded from DLPack. One thing to be noted, if we get + out (Tensor), a tensor decoded from DLPack. One thing to be noted, if we get an input dltensor with data type as `bool`, we return the decoded tensor as `uint8`.