Skip to content

Commit

Permalink
[映射文档] update torch.quantile and torch.nanquantile and tensor met…
Browse files Browse the repository at this point in the history
…hod (#6579)

* update quantile

* update signature
  • Loading branch information
RedContritio authored Apr 3, 2024
1 parent edf1bc5 commit be7ca4e
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## [ torch 参数更多 ] torch.Tensor.nanquantile
## [ 仅参数名不一致 ] torch.Tensor.nanquantile

### [torch.Tensor.nanquantile](https://pytorch.org/docs/stable/generated/torch.nanquantile.html#torch.nanquantile)

Expand All @@ -9,10 +9,10 @@ torch.Tensor.nanquantile(q, dim=None, keepdim=False, *, interpolation='linear')
### [paddle.Tensor.nanquantile](https://github.com/PaddlePaddle/Paddle/pull/41343)

```python
paddle.Tensor.nanquantile(q, axis=None, keepdim=False)
paddle.Tensor.nanquantile(q, axis=None, keepdim=False, interpolation='linear')
```

PyTorch 相比 Paddle 支持更多其他参数,具体如下:
两者功能一致且参数用法一致,仅参数名不一致,具体如下:

### 参数映射

Expand All @@ -21,4 +21,4 @@ PyTorch 相比 Paddle 支持更多其他参数,具体如下:
| q | q | 待计算的分位数。|
| dim | axis | 求乘积运算的维度,仅参数名不一致。 |
| keepdim | keepdim | 是否在输出 Tensor 中保留输入的维度。 |
| interpolation | interpolation | 指定当所需分位数位于两个数据点之间时使用的插值方法。|
| interpolation | interpolation | 指定当所需分位数位于两个数据点之间时使用的插值方法。 |
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## [torch 参数更多]torch.Tensor.quantile
## [ 仅参数名不一致 ]torch.Tensor.quantile

### [torch.Tensor.quantile](https://pytorch.org/docs/stable/generated/torch.Tensor.quantile.html#torch.Tensor.quantile)

Expand All @@ -12,13 +12,13 @@ torch.Tensor.quantile(q, dim=None, keepdim=False, *, interpolation='linear')
paddle.Tensor.quantile(q, axis=None, keepdim=False, interpolation='linear', name=None)
```

PyTorch 相比 Paddle 支持更多其他参数,具体如下:
两者功能一致且参数用法一致,仅参数名不一致,具体如下:

### 参数映射

| PyTorch | PaddlePaddle | 备注 |
| ------- | ------------ | ------------------------ |
| q | q |待计算的分位数。 |
| dim | axis |指定对 x 进行计算的轴,仅参数名不一致。|
| keepdim | keepdim |是否在输出 Tensor 中保留减小的维度。|
| interpolation | interpolation |两个数据点的插补取值方法|
| q | q | 待计算的分位数。 |
| dim | axis | 指定对 x 进行计算的轴,仅参数名不一致。|
| keepdim | keepdim | 是否在输出 Tensor 中保留减小的维度。|
| interpolation | interpolation | 两个数据点的插补取值方法|
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,28 @@ torch.nanquantile(input,
out=None)
```

### [paddle.nanquantile]()
### [paddle.nanquantile](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nanquantile_cn.html#nanquantile)

```python
paddle.nanquantile(x,
q,
axis=None,
keepdim=False,
interpolation='linear',
name=None)
q,
axis=None,
keepdim=False,
interpolation='linear',
name=None)
```

PyTorch 相比 Paddle 支持更多其他参数,具体如下:

### 参数映射

| PyTorch | PaddlePaddle | 备注 |
| ------------- | ------------ | ------------------------------------------------------ |
| input | x | 表示输入的 Tensor,仅参数名不一致。 |
| q | q | 待计算的分位数。 |
| dim | axis| 指定对 x 进行计算的轴,仅参数名不一致。 |
|keepdim|keepdim| 是否在输出 Tensor 中保留减小的维度。|
|interpolation| interpolation | 当所需分位数位于两个数据点之间时使用的插值方法|
| dim | axis | 指定对 x 进行计算的轴,仅参数名不一致。 |
| keepdim | keepdim | 是否在输出 Tensor 中保留减小的维度。|
| interpolation | interpolation | 当所需分位数位于两个数据点之间时使用的插值方法|
| out | - | 表示输出的 Tensor,Paddle 无此参数,需要转写。 |


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,16 @@ paddle.quantile(x,
```

PyTorch 相比 Paddle 支持更多其他参数,具体如下:

### 参数映射

| PyTorch | PaddlePaddle | 备注 |
| ------------- | ------------ | ------------------------------------------------------ |
| input | x | 表示输入的 Tensor,仅参数名不一致。 |
| q | q | 待计算的分位数。 |
| dim | axis| 指定对 x 进行计算的轴,仅参数名不一致。 |
|keepdim|keepdim| 是否在输出 Tensor 中保留减小的维度。|
|interpolation| interpolation | 当所需分位数位于两个数据点之间时使用的插值方|
| dim | axis | 指定对 x 进行计算的轴,仅参数名不一致。 |
| keepdim | keepdim | 是否在输出 Tensor 中保留减小的维度。 |
| interpolation | interpolation | 当所需分位数位于两个数据点之间时使用的插值方法|
| out | - | 表示输出的 Tensor,Paddle 无此参数,需要转写。 |


Expand Down

0 comments on commit be7ca4e

Please # to comment.