未验证 提交 b89cea33 编写于 作者: Y yuchen202 提交者: GitHub

修改了API文档的相关内容 (#49055)

* 修改了API文档的相关内容

对weight_norm进行修改

* Update python/paddle/profiler/utils.py

* Update python/paddle/utils/cpp_extension/cpp_extension.py

* Update python/paddle/device/__init__.py

* Update python/paddle/device/__init__.py

* test=document_fix

* for Hyperlink; test=document_fix

* Update dlpack.py

* test=document_fix
Co-authored-by: NLigoml <39876205+Ligoml@users.noreply.github.com>
上级 2190ea09
......@@ -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
......
......@@ -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.
......
......@@ -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
<https://arxiv.org/pdf/1602.07868.pdf>`_.
......
......@@ -63,7 +63,7 @@ class RecordEvent(ContextDecorator):
result = data1 + data2
record_event.end()
**Note**:
Note:
RecordEvent will take effect only when :ref:`Profiler <api_paddle_profiler_Profiler>` is on and at the state of `RECORD`.
"""
......
......@@ -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`.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册