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 e6a04b8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 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 @@ -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 e6a04b8

Please sign in to comment.