-
Notifications
You must be signed in to change notification settings - Fork 827
映射文档 torch.nn.functional.embedding #5928
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
Open
LokeZhou
wants to merge
11
commits into
PaddlePaddle:develop
Choose a base branch
from
LokeZhou:add_embedding
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
dd20f51
add convert_from_pytoch function.embedding md
LokeZhou 024994a
add binary_cross_entropy and unfold doc
LokeZhou 2c3077a
add exp
LokeZhou b1ed752
fix function unfold
LokeZhou 1cec3cd
fix comment
LokeZhou e6d3e11
Merge branch 'develop' into add_embedding
LokeZhou d18c28f
fix unfold ci
LokeZhou 48cbfa6
fix unfold ci
LokeZhou 8d51079
add args
LokeZhou 5d047de
delete some exp
LokeZhou d1c42c0
Merge branch 'develop' into add_embedding
LokeZhou File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
add convert_from_pytoch function.embedding md
- Loading branch information
commit dd20f51d096b024bf7cdc385f9380d3071fa3f52
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
...convert_from_pytorch/api_difference/functional/torch.nn.functional.embedding.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
## [ torch 参数更多 ]torch.nn.functional.embedding | ||
### [torch.nn.functional.embedding](https://pytorch.org/docs/stable/generated/torch.nn.functional.embedding.html?highlight=torch+nn+functional+embedding#torch.nn.functional.embedding) | ||
|
||
```python | ||
torch.nn.functional.embedding(input, | ||
weight, | ||
padding_idx=None, | ||
max_norm=None, | ||
norm_type=2.0, | ||
scale_grad_by_freq=False, | ||
sparse=False) | ||
``` | ||
### [paddle.nn.functional.embedding](https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/nn/functional/embedding_cn.html#embedding) | ||
|
||
```python | ||
paddle.nn.functional.embedding(x, | ||
weight, | ||
padding_idx=None, | ||
sparse=False, | ||
name=None) | ||
``` | ||
|
||
其中 Pytorch 相比 Paddle 支持更多其他参数,具体如下: | ||
### 参数映射 | ||
| PyTorch | PaddlePaddle | 备注 | | ||
| ------------- | ------------ | ------------------------------------------------------ | | ||
| input | x | 表示存储id信息的Tensor | | ||
| weight | weight | 表示存储词嵌入权重参数的 Tensor | | ||
| padding_idx | padding_idx | 在此区间内的参数及对应的梯度将会以 0 进行填充 | | ||
| max_norm | - | 如果给定,Embeddding 向量的范数(范数的计算方式由 norm_type 决定)超过了 max_norm 这个界限,就要再进行归一化,PaddlePaddle 无此功能,暂无转写方式。 | | ||
| norm_type | - | 为 maxnorm 选项计算 p-范数的 p。默认值 2,PaddlePaddle 暂无此功能,暂无转写方式。 | | ||
| scale_grad_by_freq | - | 是否根据单词在 mini-batch 中出现的频率,对梯度进行放缩,PaddlePaddle 暂无此功能。 | | ||
| sparse | sparse | 表示是否使用稀疏更新。 | | ||
| - | name | Pytorch 无此参数,Paddle 保持默认即可。 | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 所有API的name参数,都忽略即可 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
少了个 暂无转写方式。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
写成统一一致的吧:暂无转写方式