Skip to content

Conversation

@IvanLauLinTiong
Copy link

@IvanLauLinTiong IvanLauLinTiong commented Jun 8, 2024

Fixes #2849

Description

Change forward method of class TokenEmbedding by converting multiplication into division operation.

Checklist

  • The issue that is being fixed is referred in the description (see above "Fixes #ISSUE_NUMBER")
  • Only one issue is addressed in this pull request
  • Labels from the issue that this PR is fixing are added to this pull request
  • No unnecessary issues are included into this pull request.

cc @subramen @albanD @sekyondaMeta @svekars @kit1980 @brycebortree

@pytorch-bot
Copy link

pytorch-bot bot commented Jun 8, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/tutorials/2915

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit a5b37c9 with merge base 6537199 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@svekars svekars added core Tutorials of any level of difficulty related to the core pytorch functionality intro labels Jun 10, 2024
@svekars svekars requested a review from kit1980 June 10, 2024 15:49
@kit1980
Copy link
Contributor

kit1980 commented Jun 10, 2024

Looking online, there are some discussions and looks like * is actually correct.
https://stackoverflow.com/questions/56930821/why-does-embedding-vector-multiplied-by-a-constant-in-transformer-model

I'm closing this, if someone more knowledgeable wants to correct me - please re-open.

@kit1980 kit1980 closed this Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla signed core Tutorials of any level of difficulty related to the core pytorch functionality docathon-h1-2024 easy intro

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Transformer tutorial multiplying with sqrt(d_model)

4 participants