Skip to content
74 changes: 37 additions & 37 deletions docs/api/paddle/Tensor__upper_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ add(y, name=None, \*, alpha=1, out=None)
add_(y, name=None, \*, alpha=1, out=None)
:::::::::

Inplace 版本的 :ref:`cn_api_paddle_add` API,对输入 `x` 采用 Inplace 策略。
Inplace 版本的 :ref:`cn_api_paddle_add` API,对输入 ``x`` 采用 Inplace 策略。

add_n(inputs, name=None)
:::::::::
Expand Down Expand Up @@ -641,7 +641,7 @@ COPY-FROM: paddle.Tensor.apply
apply_(callable)
:::::::::

Inplace 版本的 `apply` API,对输入 `x` 采用 Inplace 策略。
Inplace 版本的 ``apply`` API,对输入 ``x`` 采用 Inplace 策略。

argmax(axis=None, keepdim=False, dtype=int64, name=None)
:::::::::
Expand Down Expand Up @@ -978,7 +978,7 @@ bincount(weights=None, minlength=0)
bernoulli_(p=0.5, name=None)
:::::::::

Inplace 版本的 :ref:`cn_api_paddle_bernoulli` API,对输入 `x` 采用 Inplace 策略。
Inplace 版本的 :ref:`cn_api_paddle_bernoulli` API,对输入 ``x`` 采用 Inplace 策略。

bitwise_and(y, out=None, name=None)
:::::::::
Expand Down Expand Up @@ -1072,7 +1072,7 @@ ceil(name=None)
ceil_(name=None)
:::::::::

Inplace 版本的 :ref:`cn_api_paddle_ceil` API,对输入 `x` 采用 Inplace 策略。
Inplace 版本的 :ref:`cn_api_paddle_ceil` API,对输入 ``x`` 采用 Inplace 策略。

cholesky(upper=False, name=None)
:::::::::
Expand Down Expand Up @@ -1123,7 +1123,7 @@ clip(min=None, max=None, name=None)
clip_(min=None, max=None, name=None)
:::::::::

Inplace 版本的 :ref:`cn_api_paddle_clip` API,对输入 `x` 采用 Inplace 策略。
Inplace 版本的 :ref:`cn_api_paddle_clip` API,对输入 ``x`` 采用 Inplace 策略。

clone()
:::::::::
Expand Down Expand Up @@ -1423,7 +1423,7 @@ exp(name=None)
exp_(name=None)
:::::::::

Inplace 版本的 :ref:`cn_api_paddle_exp` API,对输入 `x` 采用 Inplace 策略。
Inplace 版本的 :ref:`cn_api_paddle_exp` API,对输入 ``x`` 采用 Inplace 策略。

expand(shape, name=None)
:::::::::
Expand Down Expand Up @@ -1583,7 +1583,7 @@ fill_diagonal_tensor(x, y, offset=0, dim1=0, dim2=1, name=None)
fill_diagonal_tensor_(x, y, offset=0, dim1=0, dim2=1, name=None)
:::::::::

Inplace 版本的 :ref:`cn_api_paddle_fill_diagonal_tensor` API,对输入 `x` 采用 Inplace 策略。
Inplace 版本的 :ref:`cn_api_paddle_fill_diagonal_tensor` API,对输入 ``x`` 采用 Inplace 策略。

**代码示例**
.. code-block:: python
Expand All @@ -1606,7 +1606,7 @@ flatten(start_axis=0, stop_axis=-1, name=None)
flatten_(start_axis=0, stop_axis=-1, name=None)
:::::::::

Inplace 版本的 :ref:`cn_api_paddle_flatten` API,对输入 `x` 采用 Inplace 策略。
Inplace 版本的 :ref:`cn_api_paddle_flatten` API,对输入 ``x`` 采用 Inplace 策略。

flip(axis, name=None)
:::::::::
Expand Down Expand Up @@ -1638,7 +1638,7 @@ floor(name=None)
floor_(name=None)
:::::::::

Inplace 版本的 :ref:`cn_api_paddle_floor` API,对输入 `x` 采用 Inplace 策略。
Inplace 版本的 :ref:`cn_api_paddle_floor` API,对输入 ``x`` 采用 Inplace 策略。

floor_divide(y, name=None)
:::::::::
Expand Down Expand Up @@ -2055,7 +2055,7 @@ logsumexp(axis=None, keepdim=False, name=None)
log_normal_(mean=0.0, std=1.0, name=None)
:::::::::

Inplace 版本的 :ref:`cn_api_paddle_log_normal` API,对输入 `x` 采用 Inplace 策略。
Inplace 版本的 :ref:`cn_api_paddle_log_normal` API,对输入 ``x`` 采用 Inplace 策略。

请参考 :ref:`cn_api_paddle_logsumexp`

Expand Down Expand Up @@ -2385,7 +2385,7 @@ reciprocal(name=None)
reciprocal_(name=None)
:::::::::

Inplace 版本的 :ref:`cn_api_paddle_reciprocal` API,对输入 `x` 采用 Inplace 策略。
Inplace 版本的 :ref:`cn_api_paddle_reciprocal` API,对输入 ``x`` 采用 Inplace 策略。

register_hook(hook)
:::::::::
Expand Down Expand Up @@ -2462,7 +2462,7 @@ remainder_(y, name=None)

返回类型:Tensor

Inplace 版本的 :ref:`cn_api_paddle_remainder` API,对输入 `x` 采用 Inplace 策略。
Inplace 版本的 :ref:`cn_api_paddle_remainder` API,对输入 ``x`` 采用 Inplace 策略。

reshape(shape, name=None)
:::::::::
Expand All @@ -2485,7 +2485,7 @@ ravel()
reshape_(shape, name=None)
:::::::::

Inplace 版本的 :ref:`cn_api_paddle_reshape` API,对输入 `x` 采用 Inplace 策略
Inplace 版本的 :ref:`cn_api_paddle_reshape` API,对输入 ``x`` 采用 Inplace 策略

roll(shifts, axis=None, name=None)
:::::::::
Expand All @@ -2508,7 +2508,7 @@ round(name=None)
round_(name=None)
:::::::::

Inplace 版本的 :ref:`cn_api_paddle_round` API,对输入 `x` 采用 Inplace 策略。
Inplace 版本的 :ref:`cn_api_paddle_round` API,对输入 ``x`` 采用 Inplace 策略。

rsqrt(name=None)
:::::::::
Expand All @@ -2522,7 +2522,7 @@ rsqrt(name=None)
rsqrt_(name=None)
:::::::::

Inplace 版本的 :ref:`cn_api_paddle_rsqrt` API,对输入 `x` 采用 Inplace 策略。
Inplace 版本的 :ref:`cn_api_paddle_rsqrt` API,对输入 ``x`` 采用 Inplace 策略。

scale(scale=1.0, bias=0.0, bias_after_scale=True, act=None, name=None)
:::::::::
Expand All @@ -2536,7 +2536,7 @@ scale(scale=1.0, bias=0.0, bias_after_scale=True, act=None, name=None)
scale_(scale=1.0, bias=0.0, bias_after_scale=True, act=None, name=None)
:::::::::

Inplace 版本的 :ref:`cn_api_paddle_scale` API,对输入 `x` 采用 Inplace 策略。
Inplace 版本的 :ref:`cn_api_paddle_scale` API,对输入 ``x`` 采用 Inplace 策略。

scatter(index, updates, overwrite=True, name=None)
:::::::::
Expand All @@ -2550,7 +2550,7 @@ scatter(index, updates, overwrite=True, name=None)
scatter_(index, updates, overwrite=True, name=None)
:::::::::

Inplace 版本的 :ref:`cn_api_paddle_scatter` API,对输入 `x` 采用 Inplace 策略。
Inplace 版本的 :ref:`cn_api_paddle_scatter` API,对输入 ``x`` 采用 Inplace 策略。

scatter_add(index, updates, overwrite=True, name=None)
:::::::::
Expand Down Expand Up @@ -2761,7 +2761,7 @@ sqrt(name=None, \*, out=None)
sqrt_(name=None)
:::::::::

Inplace 版本的 :ref:`cn_api_paddle_sqrt` API,对输入 `x` 采用 Inplace 策略。
Inplace 版本的 :ref:`cn_api_paddle_sqrt` API,对输入 ``x`` 采用 Inplace 策略。

square(name=None)
:::::::::
Expand All @@ -2784,7 +2784,7 @@ squeeze(axis=None, name=None)
squeeze_(axis=None, name=None)
:::::::::

Inplace 版本的 :ref:`cn_api_paddle_squeeze` API,对输入 `x` 采用 Inplace 策略。
Inplace 版本的 :ref:`cn_api_paddle_squeeze` API,对输入 ``x`` 采用 Inplace 策略。

stack(axis=0, name=None)
:::::::::
Expand Down Expand Up @@ -2834,7 +2834,7 @@ subtract(y, name=None, \*, alpha=1, out=None)
subtract_(y, name=None, \*, alpha=1)
:::::::::

Inplace 版本的 :ref:`cn_api_paddle_subtract` API,对输入 `x` 采用 Inplace 策略。
Inplace 版本的 :ref:`cn_api_paddle_subtract` API,对输入 ``x`` 采用 Inplace 策略。

sub(y, name=None, \*, alpha=1, out=None)
:::::::::
Expand All @@ -2848,7 +2848,7 @@ sub(y, name=None, \*, alpha=1, out=None)
sub_(y, name=None, \*, alpha=1)
:::::::::

Inplace 版本的 :ref:`cn_api_paddle_sub` API,对输入 `x` 采用 Inplace 策略。
Inplace 版本的 :ref:`cn_api_paddle_sub` API,对输入 ``x`` 采用 Inplace 策略。

sum(axis=None, dtype=None, keepdim=False, name=None)
:::::::::
Expand Down Expand Up @@ -2898,7 +2898,7 @@ tanh(name=None)
tanh_(name=None)
:::::::::

Inplace 版本的 :ref:`cn_api_paddle_tan` API,对输入 `x` 采用 Inplace 策略。
Inplace 版本的 :ref:`cn_api_paddle_tan` API,对输入 ``x`` 采用 Inplace 策略。

tile(repeat_times, name=None)
:::::::::
Expand Down Expand Up @@ -3096,7 +3096,7 @@ unsqueeze(axis, name=None)
unsqueeze_(axis, name=None)
:::::::::

Inplace 版本的 :ref:`cn_api_paddle_unsqueeze` API,对输入 `x` 采用 Inplace 策略。
Inplace 版本的 :ref:`cn_api_paddle_unsqueeze` API,对输入 ``x`` 采用 Inplace 策略。

unstack(axis=0, num=None)
:::::::::
Expand All @@ -3119,16 +3119,16 @@ var(axis=None, unbiased=True, keepdim=False, name=None)
where(x, y, name=None)
:::::::::

调用该 `where` 方法的 `Tensor` 作为 `condition` 来选择 `x` 或 `y` 中的对应元素组成新的 `Tensor` 并返回。
调用该 ``where`` 方法的 ``Tensor`` 作为 ``condition`` 来选择 ``x`` 或 ``y`` 中的对应元素组成新的 ``Tensor`` 并返回。

返回:计算后的 Tensor

返回类型:Tensor

.. note::
只有 `bool` 类型的 `Tensor` 才能调用该方法。
只有 ``bool`` 类型的 ``Tensor`` 才能调用该方法。

示例:`(x>0).where(x, y)`, 其中 x, y 都是数值 `Tensor`。
示例:``(x>0).where(x, y)``, 其中 x, y 都是数值 ``Tensor``。

请参考 :ref:`cn_api_paddle_where`

Expand Down Expand Up @@ -3173,7 +3173,7 @@ lerp(x, y, weight, name=None)
lerp_(y, weight, name=None)
:::::::::

Inplace 版本的 :ref:`cn_api_paddle_lerp` API,对输入 `x` 采用 Inplace 策略。
Inplace 版本的 :ref:`cn_api_paddle_lerp` API,对输入 ``x`` 采用 Inplace 策略。


is_complex()
Expand Down Expand Up @@ -3357,7 +3357,7 @@ nnz()
:::::::::

.. note::
只有 `SparseCooTensor` 、`SparseCsrTensor` 才可调用该方法。
只有 ``SparseCooTensor`` 、``SparseCsrTensor`` 才可调用该方法。

返回:输入稀疏 Tensor 的非 0 元素的个数

Expand All @@ -3380,7 +3380,7 @@ indices()
:::::::::

.. note::
只有 `SparseCooTensor` 才可调用该方法。
只有 ``SparseCooTensor`` 才可调用该方法。

返回:输入 SparseCooTensor 的非 0 元素的索引

Expand All @@ -3405,7 +3405,7 @@ values()
:::::::::

.. note::
只有 `SparseCooTensor` 才可调用该方法。
只有 ``SparseCooTensor`` 才可调用该方法。

返回:输入 SparseCooTensor 的非 0 元素的值

Expand All @@ -3430,7 +3430,7 @@ crows()
:::::::::

.. note::
只有 `SparseCsrTensor` 才可调用该方法。
只有 ``SparseCsrTensor`` 才可调用该方法。

返回:输入 SparseCsrTensor 的非 0 元素的压缩行信息

Expand All @@ -3455,7 +3455,7 @@ cols()
:::::::::

.. note::
只有 `SparseCsrTensor` 才可调用该方法。
只有 ``SparseCsrTensor`` 才可调用该方法。

返回:输入 SparseCsrTensor 的非 0 元素的列信息

Expand Down Expand Up @@ -3548,7 +3548,7 @@ to_sparse_csr()
:::::::::

.. note::
只有 `DenseTensor` 、`SparseCooTensor` 才可调用该方法。
只有 ``DenseTensor`` 、``SparseCooTensor`` 才可调用该方法。

将输入 Tensor 转换为 SparseCsrTensor。

Expand Down Expand Up @@ -3689,7 +3689,7 @@ masked_fill(x, mask, value, name=None)
masked_fill_(x, mask, value, name=None)
:::::::::

Inplace 版本的 :ref:`cn_api_paddle_masked_fill` API,对输入 `x` 采用 Inplace 策略。
Inplace 版本的 :ref:`cn_api_paddle_masked_fill` API,对输入 ``x`` 采用 Inplace 策略。

masked_scatter(x, mask, value, name=None)
:::::::::
Expand All @@ -3702,7 +3702,7 @@ masked_scatter(x, mask, value, name=None)
masked_scatter_(x, mask, value, name=None)
:::::::::

Inplace 版本的 :ref:`cn_api_paddle_masked_scatter` API,对输入 `x` 采用 Inplace 策略。
Inplace 版本的 :ref:`cn_api_paddle_masked_scatter` API,对输入 ``x`` 采用 Inplace 策略。

atleast_1d(name=None)
:::::::::
Expand Down Expand Up @@ -3751,7 +3751,7 @@ select_scatter(x, values, axis, index, name=None)
slice_scatter(value, axes, starts, ends, strides, name=None)
:::::::::

沿着 `axes` 将 `value` 矩阵的值嵌入到 `x` 矩阵。返回一个新的 Tensor 而不是视图。
沿着 ``axes`` 将 ``value`` 矩阵的值嵌入到 ``x`` 矩阵。返回一个新的 Tensor 而不是视图。

返回:计算后的 Tensor

Expand All @@ -3773,7 +3773,7 @@ signbit(x, name=None)
block_diag(inputs, name=None)
:::::::::

根据 `inputs` 创建对角矩阵。
根据 ``inputs`` 创建对角矩阵。

返回:对角矩阵 Tensor。

Expand Down
2 changes: 1 addition & 1 deletion docs/api/paddle/atleast_2d_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ atleast_2d

将输入转换为张量并返回至少为 ``2`` 维的视图。 ``2`` 维或更高维的输入会被保留。

下图分别展示了 `atleast_2d` 在不同数据类型下,对 1 个 `0` 维张量输入、1 个 `0` 维张量输入和 1 个 `1` 维张量输入,以及 1 个 `0` 维张量输入和 1 个 `3` 维张量输入,将其返回为至少为 `2` 维视图的张量或张量 list 的情形。
下图分别展示了 ``atleast_2d`` 在不同数据类型下,对 1 个 ``0`` 维张量输入、1 个 ``0`` 维张量输入和 1 个 ``1`` 维张量输入,以及 1 个 ``0`` 维张量输入和 1 个 ``3`` 维张量输入,将其返回为至少为 ``2`` 维视图的张量或张量 list 的情形。

.. image:: ../../images/api_legend/atleast_2d.png
:width: 600
Expand Down
8 changes: 4 additions & 4 deletions docs/api/paddle/cdist_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ cdist

计算两组输入集合中每对之间的 p 范数距离。

当 :math:`p \in (0, \infty)` 时,该函数等同于 `scipy.spatial.distance.cdist(input,'minkowski', p=p)` ;
当 :math:`p = 0` 时,等同于 `scipy.spatial.distance.cdist(input, 'hamming') * M` ;
当 :math:`p = \infty` 时,最接近的是 `scipy.spatial.distance.cdist(xn, lambda x, y: np.abs(x - y).max())` 。
当 :math:`p \in (0, \infty)` 时,该函数等同于 ``scipy.spatial.distance.cdist(input,'minkowski', p=p)`` ;
当 :math:`p = 0` 时,等同于 ``scipy.spatial.distance.cdist(input, 'hamming') * M`` ;
当 :math:`p = \infty` 时,最接近的是 ``scipy.spatial.distance.cdist(xn, lambda x, y: np.abs(x - y).max())`` 。

参数
::::::::::::
Expand All @@ -28,7 +28,7 @@ cdist

返回
::::::::::::
Tensor,`dtype` 与输入张量相同。
Tensor,``dtype`` 与输入张量相同。
如果 x 的形状为 :math:`B \times P \times M`,y 的形状为 :math:`B \times R \times M`,则输出的形状为 :math:`B \times P \times R`。

代码示例
Expand Down
4 changes: 2 additions & 2 deletions docs/api/paddle/combinations_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ combinations

.. py:function:: paddle.combinations(x, r=2, with_replacement=False, name=None)

对输入 Tensor 计算长度为 r 的情况下的所有组合,当 `with_replacement` 设为 False,可类比 python 内置 API `itertools.combinations` 。
当 `with_replacement` 设为 True,可类比 python 内置 API `itertools.combinations_with_replacement(with_replacement=True)`。
对输入 Tensor 计算长度为 r 的情况下的所有组合,当 ``with_replacement`` 设为 False,可类比 python 内置 API ``itertools.combinations`` 。
当 ``with_replacement`` 设为 True,可类比 python 内置 API ``itertools.combinations_with_replacement(with_replacement=True)``。

参数
::::::::::
Expand Down
4 changes: 2 additions & 2 deletions docs/api/paddle/compat/Overview_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ PyTorch 兼容函数
:header: "API 名称", "API 功能"
:widths: 10, 30

" :ref:`max <cn_api_paddle_compat_max>` ", "包含 `amax`、同时返回 values 及 indices 的轴向最大值、`maximum` 三种功能"
" :ref:`max <cn_api_paddle_compat_max>` ", "包含 ``amax``、同时返回 values 及 indices 的轴向最大值、``maximum`` 三种功能"
" :ref:`median <cn_api_paddle_compat_median>` ", "兼容版中位数,支持 dim/keepdim/out 签名"
" :ref:`min <cn_api_paddle_compat_min>` ", "包含 `amin`、同时返回 values 及 indices 的轴向最小值、`minimum` 三种功能"
" :ref:`min <cn_api_paddle_compat_min>` ", "包含 ``amin``、同时返回 values 及 indices 的轴向最小值、``minimum`` 三种功能"
" :ref:`nanmedian <cn_api_paddle_compat_nanmedian>` ", "忽略 NaN 的兼容版中位数,支持 dim/keepdim/out 签名"
" :ref:`slogdet <cn_api_paddle_compat_slogdet>` ", "slogdet 函数"
" :ref:`sort <cn_api_paddle_compat_sort>` ", "同时返回 values 及 indices 的排序"
Expand Down
4 changes: 2 additions & 2 deletions docs/api/paddle/diagonal_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ diagonal
.. py:function:: paddle.diagonal(x, offset=0, axis1=0, axis2=1, name=None)


根据参数 `offset`、`axis1`、`axis2`,返回输入 `Tensor` 的局部视图。
根据参数 ``offset``、``axis1``、``axis2``,返回输入 ``Tensor`` 的局部视图。

如果输入是 2D Tensor,则返回对角线元素。

如果输入的维度大于 2D,则返回由对角线元素组成的数组,其中对角线从由 axis1 和 axis2 指定的二维平面中获得。默认由输入的前两维组成获得对角线的 2D 平面。

参数 `offset` 确定从指定的二维平面中获取对角线的位置:
参数 ``offset`` 确定从指定的二维平面中获取对角线的位置:

- 如果 offset = 0,则取主对角线。
- 如果 offset > 0,则取主对角线右上的对角线。
Expand Down
Loading
Loading