Skip to content

Commit

Permalink
update incorrect desc
Browse files Browse the repository at this point in the history
  • Loading branch information
RedContritio committed Mar 8, 2024
1 parent 29cdf85 commit a3419ce
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## [ 参数不一致 ]torch.nn.functional.embedding
## [torch 参数]torch.nn.functional.embedding

### [torch.nn.functional.embedding](https://pytorch.org/docs/stable/generated/torch.nn.functional.embedding.html)

Expand All @@ -12,7 +12,7 @@ torch.nn.functional.embedding(input, weight, padding_idx=None, max_norm=None, no
paddle.nn.functional.embedding(x, weight, padding_idx=None, sparse=False, name=None)
```

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

### 参数映射

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ PyTorch 相比 Paddle 支持更多其他参数,具体如下:

| PyTorch | PaddlePaddle | 备注 |
| ------------ | ------------ | -- |
| input | input | 输入 Tensor,仅参数名不一致|
| input | input | 输入 Tensor。 |
| target | label | 标签 Tensor,仅参数名不一致。 |
| p | p | 手动指定范数。|
| margin | margin | 手动指定间距。 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ PyTorch 相比 Paddle 支持更多其他参数,具体如下:

| PyTorch | PaddlePaddle | 备注 |
| ------------ | ------------ | -- |
| input | input | 输入 Tensor,仅参数名不一致|
| input | input | 输入 Tensor。 |
| target | label | 标签 Tensor,仅参数名不一致。 |
| weight | weight | 手动指定每个 batch 二值交叉熵的权重。 |
| size_average | - | PyTorch 已弃用, Paddle 无此参数,需要转写。 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ torch.nn.functional.rrelu_(input, lower=1./8, upper=1./3, training=False)
paddle.nn.functional.rrelu(x, lower=1./8., upper=1./3., training=True, name=None)
```

其中 PyTorch 和 Paddle 功能一致,参数名与参数默认值不一致,具体如下:
其中 PyTorch 和 Paddle 功能基本一致,前者会在不变更变量内存地址的情况下,直接改变变量的值,一般对网络训练结果影响不大。参数名与参数默认值不一致,具体如下:

### 参数映射

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ paddle.mode(x, axis=-1, keepdim=False, name=None)

| PyTorch | PaddlePaddle | 备注 |
| ------- | ------------ | -- |
| input | x | 输入的多维 Tensor。 |
| input | x | 输入的多维 Tensor,仅参数名不一致|
| dim | axis | 指定对输入 Tensor 进行运算的轴,仅参数名不一致。 |
| keepdim | keepdim | 是否保留指定的轴。 |
| out | - | 表示输出的 Tensor , Paddle 无此参数,需要转写。 |
Expand All @@ -31,5 +31,5 @@ torch.mode(x, dim, False, out=(a, b))

# Paddle 写法
out1, out2 = paddle.mode(x, dim, False)
paddle.assign(out1, (a, b)[0]), paddle.assign(out2, (a, b)[1])
paddle.assign(out1, a), paddle.assign(out2, b)
```

0 comments on commit a3419ce

Please sign in to comment.