Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jayparks committed Jan 25, 2018
1 parent 37320d4 commit 667faad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions transformer/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ def __init__(self, max_seq_len, d_word_vec):
for pos in range(max_seq_len)])
pos_enc[:, 0::2] = np.sin(pos_enc[:, 0::2])
pos_enc[:, 1::2] = np.cos(pos_enc[:, 1::2])
pad_row = np.zeros([1, d_word_vec]).astype(np.float32)
pos_enc = np.concatenate([pad_row, pos_enc])
pad_row = np.zeros([1, d_word_vec])
pos_enc = np.concatenate([pad_row, pos_enc]).astype(np.float32)

# additional single row for PAD idx
self.pos_enc = nn.Embedding(max_seq_len + 1, d_word_vec)
Expand Down

0 comments on commit 667faad

Please sign in to comment.