Skip to content

Commit 427373c

Browse files
committed
Merge remote-tracking branch 'origin/alpha0.0.1a4' into alpha0.0.1a4
2 parents e31ff4c + 8595b43 commit 427373c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bert_pytorch/model/embedding/position.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def __init__(self, d_model, max_len=512):
1313
pe.require_grad = False
1414

1515
position = torch.arange(0, max_len).float().unsqueeze(1)
16-
div_term = (torch.arange(0, d_model, 2) * -(math.log(10000.0) / d_model)).float().exp()
16+
div_term = (torch.arange(0, d_model, 2).float() * -(math.log(10000.0) / d_model)).exp()
1717

1818
pe[:, 0::2] = torch.sin(position * div_term)
1919
pe[:, 1::2] = torch.cos(position * div_term)

0 commit comments

Comments
 (0)