Skip to content

Commit 2e440e0

Browse files
authored
Update dataloader.py
1 parent 2442e8b commit 2e440e0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

codes/dataloader.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ def __getitem__(self, idx):
5959

6060
negative_sample = np.concatenate(negative_sample_list)[:self.negative_sample_size]
6161

62-
negative_sample = torch.from_numpy(negative_sample)
63-
62+
negative_sample = torch.LongTensor(negative_sample)
63+
6464
positive_sample = torch.LongTensor(positive_sample)
6565

6666
return positive_sample, negative_sample, subsampling_weight, self.mode
@@ -181,4 +181,4 @@ def one_shot_iterator(dataloader):
181181
'''
182182
while True:
183183
for data in dataloader:
184-
yield data
184+
yield data

0 commit comments

Comments
 (0)