Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【Hackathon 6th No.24】paddle.quantile/nanquantile 功能增强 -part #6353

Merged
merged 9 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
merge upstream
  • Loading branch information
Asthestarsfalll committed Mar 26, 2024
commit 0417f1a800e9ec1c7319f02003cf0580cd8223c5
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,18 @@ PyTorch 相比 Paddle 支持更多其他参数,具体如下:
| q | q | 待计算的分位数。|
| dim | axis | 求乘积运算的维度,仅参数名不一致。 |
| keepdim | keepdim | 是否在输出 Tensor 中保留输入的维度。 |
<<<<<<< HEAD
| interpolation | interpolation | 指定当所需分位数位于两个数据点之间时使用的插值方法。|
=======
| interpolation | - | 指定当所需分位数位于两个数据点之间时使用的插值方法,Paddle 无此参数,暂无转写方式。 |

### 转写示例
```python
# 当 q 为向量时
# PyTorch 写法
x.nanquantile(q=torch.tensor([0.5, 0.1], dtype=torch.float64))

# Paddle
x.nanquantile(q=[0.5, 0.1])
```
>>>>>>> up/develop
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,13 @@ PyTorch 相比 Paddle 支持更多其他参数,具体如下:
### 转写示例
#### out:指定输出
```python
<<<<<<< HEAD
# Pytorch 写法
torch.nanquantile(torch.tensor([float('nan'), 1., 2., 3.]), 0.6, interpolation='linear', out=y)
=======
# PyTorch 写法
torch.nanquantile(torch.tensor([float('nan'), 1., 2., 3.]), 0.6, out=y)
>>>>>>> up/develop

# Paddle 写法
paddle.assign(paddle.nanquantile(paddle.to_tensor([float('nan'), 1., 2., 3.]), 0.6, interpolation='linear'), y)
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.