Skip to content

Commit 39f8476

Browse files
committed
[Docs] Batch fix inline backticks in API CN docs (round 2)
1 parent 8f4213f commit 39f8476

25 files changed

Lines changed: 61 additions & 61 deletions

docs/api/paddle/cdist_cn.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ cdist
77
88
计算两组输入集合中每对之间的 p 范数距离。
99

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

1414
参数
1515
::::::::::::
@@ -28,7 +28,7 @@ cdist
2828

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

3434
代码示例

docs/api/paddle/combinations_cn.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ combinations
55

66
.. py:function:: paddle.combinations(x, r=2, with_replacement=False, name=None)
77
8-
对输入 Tensor 计算长度为 r 的情况下的所有组合,当 `with_replacement` 设为 False,可类比 python 内置 API `itertools.combinations` 。
9-
当 `with_replacement` 设为 True,可类比 python 内置 API `itertools.combinations_with_replacement(with_replacement=True)`。
8+
对输入 Tensor 计算长度为 r 的情况下的所有组合,当 ``with_replacement`` 设为 False,可类比 python 内置 API ``itertools.combinations`` 。
9+
当 ``with_replacement`` 设为 True,可类比 python 内置 API ``itertools.combinations_with_replacement(with_replacement=True)``。
1010

1111
参数
1212
::::::::::

docs/api/paddle/compat/Overview_cn.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ PyTorch 兼容函数
1414
:header: "API 名称", "API 功能"
1515
:widths: 10, 30
1616

17-
" :ref:`max <cn_api_paddle_compat_max>` ", "包含 `amax`、同时返回 values 及 indices 的轴向最大值、`maximum` 三种功能"
17+
" :ref:`max <cn_api_paddle_compat_max>` ", "包含 ``amax``、同时返回 values 及 indices 的轴向最大值、``maximum`` 三种功能"
1818
" :ref:`median <cn_api_paddle_compat_median>` ", "兼容版中位数,支持 dim/keepdim/out 签名"
19-
" :ref:`min <cn_api_paddle_compat_min>` ", "包含 `amin`、同时返回 values 及 indices 的轴向最小值、`minimum` 三种功能"
19+
" :ref:`min <cn_api_paddle_compat_min>` ", "包含 ``amin``、同时返回 values 及 indices 的轴向最小值、``minimum`` 三种功能"
2020
" :ref:`nanmedian <cn_api_paddle_compat_nanmedian>` ", "忽略 NaN 的兼容版中位数,支持 dim/keepdim/out 签名"
2121
" :ref:`slogdet <cn_api_paddle_compat_slogdet>` ", "slogdet 函数"
2222
" :ref:`sort <cn_api_paddle_compat_sort>` ", "同时返回 values 及 indices 的排序"

docs/api/paddle/diagonal_cn.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ diagonal
66
.. py:function:: paddle.diagonal(x, offset=0, axis1=0, axis2=1, name=None)
77
88
9-
根据参数 `offset`、`axis1`、`axis2`,返回输入 `Tensor` 的局部视图。
9+
根据参数 ``offset``、``axis1``、``axis2``,返回输入 ``Tensor`` 的局部视图。
1010

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

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

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

1717
- 如果 offset = 0,则取主对角线。
1818
- 如果 offset > 0,则取主对角线右上的对角线。

docs/api/paddle/distributed/fleet/Fleet_cn.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ COPY-FROM: paddle.distributed.fleet.Fleet.init:code-init-example4
5858
is_first_worker()
5959
'''''''''
6060

61-
返回当前节点是否为第一个`worker`节点,判断当前 worker_index 是否为 0,如果为 0 则返回 True,否则返回 False。
61+
返回当前节点是否为第一个``worker``节点,判断当前 worker_index 是否为 0,如果为 0 则返回 True,否则返回 False。
6262

6363
**返回**
6464
True/False
@@ -71,7 +71,7 @@ COPY-FROM: paddle.distributed.fleet.Fleet.is_first_worker
7171
worker_index()
7272
'''''''''
7373

74-
返回当前节点的编号,每个`worker`节点被分配[0, worker_num-1]内的唯一的编码 ID
74+
返回当前节点的编号,每个``worker``节点被分配[0, worker_num-1]内的唯一的编码 ID
7575

7676
**返回**
7777
int
@@ -85,7 +85,7 @@ COPY-FROM: paddle.distributed.fleet.Fleet.worker_index
8585
worker_num()
8686
'''''''''
8787

88-
返回当前全部训练节点中`worker`节点的个数
88+
返回当前全部训练节点中``worker``节点的个数
8989

9090
**返回**
9191
int
@@ -98,7 +98,7 @@ COPY-FROM: paddle.distributed.fleet.Fleet.worker_num
9898
is_worker()
9999
'''''''''
100100

101-
返回当前节点是否为`worker`节点
101+
返回当前节点是否为``worker``节点
102102

103103
**返回**
104104
True/False
@@ -148,7 +148,7 @@ server_index()
148148
**该参数只在 ParameterServer 模式下生效**
149149

150150

151-
返回当前节点的编号,每个`server`节点被分配[0, server_num-1]内的唯一的编码 ID
151+
返回当前节点的编号,每个``server``节点被分配[0, server_num-1]内的唯一的编码 ID
152152

153153
**返回**
154154
int
@@ -187,7 +187,7 @@ is_server()
187187
**该参数只在 ParameterServer 模式下生效**
188188

189189

190-
返回当前节点是否为`server`节点
190+
返回当前节点是否为``server``节点
191191

192192
**返回**
193193
True/False

docs/api/paddle/distribution/ContinuousBernoulli_cn.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ prob(value)
7979

8080
**返回**
8181

82-
Tensor,:attr:`value` 的概率。数据类型与 `self.probs` 相同。
82+
Tensor,:attr:`value` 的概率。数据类型与 ``self.probs`` 相同。
8383

8484

8585
log_prob(value)
@@ -93,7 +93,7 @@ log_prob(value)
9393

9494
**返回**
9595

96-
Tensor,:attr:`value` 的对数概率。数据类型与 `self.probs` 相同。
96+
Tensor,:attr:`value` 的对数概率。数据类型与 ``self.probs`` 相同。
9797

9898

9999
cdf(value)
@@ -118,7 +118,7 @@ cdf(value)
118118

119119
**返回**
120120

121-
Tensor: :attr:`value` 的累积分布函数对应的 quantile 值。数据类型与 `self.probs` 相同。
121+
Tensor: :attr:`value` 的累积分布函数对应的 quantile 值。数据类型与 ``self.probs`` 相同。
122122

123123

124124
icdf(value)
@@ -142,7 +142,7 @@ icdf(value)
142142

143143
**返回**
144144

145-
Tensor,ContinuousBernoulli 随机变量在对应 quantile 下的值。数据类型与 `self.probs` 相同。
145+
Tensor,ContinuousBernoulli 随机变量在对应 quantile 下的值。数据类型与 ``self.probs`` 相同。
146146

147147

148148
sample(shape=[])

docs/api/paddle/distribution/MultivariateNormal_cn.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ prob(value)
7474

7575
**返回**
7676

77-
Tensor,:attr:`value` 的概率。数据类型与 `self.loc` 相同。
77+
Tensor,:attr:`value` 的概率。数据类型与 ``self.loc`` 相同。
7878

7979

8080
log_prob(value)
@@ -88,7 +88,7 @@ log_prob(value)
8888

8989
**返回**
9090

91-
Tensor,:attr:`value` 的对数概率。数据类型与 `self.loc` 相同。
91+
Tensor,:attr:`value` 的对数概率。数据类型与 ``self.loc`` 相同。
9292

9393

9494
sample(shape=[])
@@ -102,7 +102,7 @@ sample(shape=[])
102102

103103
**返回**
104104

105-
Tensor,样本数据。其维度为 :math:`\text{sample shape} + \text{batch shape} + \text{event shape}` 。数据类型与 `self.loc` 相同。
105+
Tensor,样本数据。其维度为 :math:`\text{sample shape} + \text{batch shape} + \text{event shape}` 。数据类型与 ``self.loc`` 相同。
106106

107107

108108
rsample(shape=[])
@@ -116,7 +116,7 @@ rsample(shape=[])
116116

117117
**返回**
118118

119-
Tensor,样本数据。其维度为 :math:`\text{sample shape} + \text{batch shape} + \text{event shape}` 。数据类型与 `self.loc` 相同。
119+
Tensor,样本数据。其维度为 :math:`\text{sample shape} + \text{batch shape} + \text{event shape}` 。数据类型与 ``self.loc`` 相同。
120120

121121

122122
entropy()
@@ -130,7 +130,7 @@ entropy()
130130
131131
**返回**
132132

133-
多元正态分布的信息熵,数据类型与 `self.loc` 相同。
133+
多元正态分布的信息熵,数据类型与 ``self.loc`` 相同。
134134

135135

136136
kl_divergence(other)
@@ -148,4 +148,4 @@ kl_divergence(other)
148148

149149
**返回**
150150

151-
相对于另一个多元正态分布的 KL 散度,数据类型与 `self.loc` 相同。
151+
相对于另一个多元正态分布的 KL 散度,数据类型与 ``self.loc`` 相同。

docs/api/paddle/einsum_cn.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ Einstein 求和是一种采用 Einstein 标记法描述的 Tensor 求和,输
2929
**关于求和标记的约定**
3030

3131
- 维度分量下标:Tensor 的维度分量下标使用英文字母表示,不区分大小写,如'ijk'表示 Tensor 维度分量为 i,j,k
32-
- 下标对应输入操作数:维度下标以`,`分段,按顺序 1-1 对应输入操作数
33-
- 广播维度:省略号`...`表示维度的广播分量,例如,'i...j'表示首末分量除外的维度需进行广播对齐
32+
- 下标对应输入操作数:维度下标以``,``分段,按顺序 1-1 对应输入操作数
33+
- 广播维度:省略号``...``表示维度的广播分量,例如,'i...j'表示首末分量除外的维度需进行广播对齐
3434
- 自由标和哑标:输入标记中仅出现一次的下标为自由标,重复出现的下标为哑标,哑标对应的维度分量将被规约消去
3535
- 输出:输出 Tensor 的维度分量既可由输入标记自动推导,也可以用输出标记定制化
3636
- 自动推导输出
3737
- 广播维度分量位于维度向量高维位置,自由标维度分量按字母顺序排序,位于维度向量低纬位置,哑标维度分量不输出
3838
- 定制化输出
39-
- 维度标记中`->`右侧为输出标记
40-
- 若输出包含广播维度,则输出标记需包含`...`
39+
- 维度标记中``->``右侧为输出标记
40+
- 若输出包含广播维度,则输出标记需包含``...``
4141
- 输出标记为空时,对输出进行全量求和,返回该标量
4242
- 输出不能包含输入标记中未出现的下标
4343
- 输出下标不可以重复出现

docs/api/paddle/grad_cn.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ grad
99
.. note::
1010
该 API 仅支持 **动态图模式**。
1111

12-
对于每个 `inputs`,计算所有 `outputs` 相对于其的梯度和。
12+
对于每个 ``inputs``,计算所有 ``outputs`` 相对于其的梯度和。
1313

1414
参数
1515
:::::::::
@@ -26,7 +26,7 @@ grad
2626
返回
2727
:::::::::
2828

29-
tuple(Tensor),其长度等于 `inputs` 中的变量个数,且第 i 个返回的变量是所有 `outputs` 相对于第 i 个 `inputs` 的梯度之和。
29+
tuple(Tensor),其长度等于 ``inputs`` 中的变量个数,且第 i 个返回的变量是所有 ``outputs`` 相对于第 i 个 ``inputs`` 的梯度之和。
3030

3131
代码示例 1
3232
:::::::::

docs/api/paddle/incubate/asp/prune_model_cn.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ prune_model
66
.. py:function:: paddle.incubate.asp.prune_model(model, n=2, m=4, mask_algo='mask_1d', with_mask=True)
77
88
9-
使用 `mask_algo` 指定的掩码生成函数裁剪 model 中支持 ASP(Auto SParsity) 的子层参数。支持训练和推理,并由 `with_mask` 参数控制。如果 with_mask 是 True ,则还会裁剪与参数相关的 ASP 掩码变量,如果是 False,则仅裁剪参数本身。
9+
使用 ``mask_algo`` 指定的掩码生成函数裁剪 model 中支持 ASP(Auto SParsity) 的子层参数。支持训练和推理,并由 ``with_mask`` 参数控制。如果 with_mask 是 True ,则还会裁剪与参数相关的 ASP 掩码变量,如果是 False,则仅裁剪参数本身。
1010

1111
.. note::
12-
- 在静态图模式下,使用 `with_mask` 调用函数时,需要先调用 OptimizerWithSparsityGuarantee.minimize 和 exe.run(startup_program) 来成功获取掩码变量。通常情况下训练时(已调用 OptimizerWithSparsityGuarantee.minimize)设置 `with_mask` 为 True。而仅进行推理时,设置 `with_mask` 为 False。 获取 OptimizerWithSparsityGuarantee 请参考 :ref:`paddle.incubate.asp.decorate <cn_api_paddle_incubate_asp_decorate>`。
12+
- 在静态图模式下,使用 ``with_mask`` 调用函数时,需要先调用 OptimizerWithSparsityGuarantee.minimize 和 exe.run(startup_program) 来成功获取掩码变量。通常情况下训练时(已调用 OptimizerWithSparsityGuarantee.minimize)设置 ``with_mask`` 为 True。而仅进行推理时,设置 ``with_mask`` 为 False。 获取 OptimizerWithSparsityGuarantee 请参考 :ref:`paddle.incubate.asp.decorate <cn_api_paddle_incubate_asp_decorate>`。
1313
- 在动态图模式下,使用 with_mask 调用函数时,需要先调用 :ref:`paddle.incubate.asp.decorate <cn_api_paddle_incubate_asp_decorate>` 来获取掩码变量。
1414

1515

0 commit comments

Comments
 (0)