In the end, we put cos and sin into a sequence: # Step 3: Concatenate and return return torch.cat([sin_embed, cos_embed], dim=-1) * math.sqrt(2) # b d In the lecture notes, we have the following equation, is this wrong? <img width="1140" height="138" alt="Image" src="https://github.com/user-attachments/assets/bbff2b9a-87cb-4a80-b863-59d317b7fd99" />
In the end, we put cos and sin into a sequence:
Step 3: Concatenate and return
In the lecture notes, we have the following equation, is this wrong?