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 5th No.3】为 Paddle 新增 masked_fill API #6254

Merged
merged 8 commits into from
Nov 2, 2023
Prev Previous commit
Next Next commit
update masked fill inplace version docs
AndSonder committed Oct 28, 2023

Verified

This commit was signed with the committer’s verified signature.
djhi Gildas Garcia
commit 5ba5c98ced6779085e50fbebe9c8eead9cff5187
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## [ 参数完全一致 ] torch.Tensor.masked_fill_

### [torch.Tensor.masked_fill_](https://pytorch.org/docs/stable/generated/torch.Tensor.masked_fill_.html?highlight=masked_fill_#torch.Tensor.masked_fill_)

```python
torch.Tensor.masked_fill_(mask, value)
```

### [paddle.Tensor.masked_fill_]()

```python
paddle.Tensor.masked_fill_(mask, value, name=None)
```

两者功能一致,参数完全一致,具体如下:

### 参数映射

| PyTorch | PaddlePaddle | 备注 |
|---------|--------------| -------------------------------------------------- |
| mask | mask | 布尔张量,表示要填充的位置 |
| value | value | 用于填充目标张量的值 |