codertimo / codertimo/BERT-pytorch

embedding/position.py with RuntimeError if d_model is odd

Open
#78 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
6.5k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

such as if set d_model = 29, max_len = 10000
RuntimeError: The expanded size of the tensor (14) must match the existing size (15) at non-singleton dimension 1. Target sizes: [10000, 14]. Tensor sizes: [10000, 15]
code in this line may be fixed (line 30):
pe[:, 1::2] = torch.cos(position * div_term)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.