Skip to content

Commit

Permalink
fix the data type in Windows
Browse files Browse the repository at this point in the history
Signed-off-by: Wang Shugen <wangshugen@ict.ac.cn>
  • Loading branch information
ictnlp-wshugen committed Jan 9, 2019
1 parent ae36e0b commit ffe3bcc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion first.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def data_gen(V, batch, nbatches):
Generate random data for a src-tgt copy task.
"""
for i in range(nbatches):
data = torch.from_numpy(numpy.random.randint(1, V, size=(batch, 10)))
data = torch.from_numpy(numpy.random.randint(1, V, size=(batch, 10))).long()
data[:, 0] = 1
src = Variable(data, requires_grad=False)
tgt = Variable(data, requires_grad=False)
Expand Down

0 comments on commit ffe3bcc

Please sign in to comment.