Skip to content

Commit

Permalink
fix removed label variable
Browse files Browse the repository at this point in the history
  • Loading branch information
abbottLane-zz committed Jun 18, 2018
1 parent 099ff55 commit 436abec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def batchify_with_label(input_batch_list, gpu, volatile_flag=False):
mask = autograd.Variable(torch.zeros((batch_size, max_seq_len)),volatile = volatile_flag).byte()
for idx, (seq, label, seqlen) in enumerate(zip(words, labels, word_seq_lengths)):
word_seq_tensor[idx, :seqlen] = torch.LongTensor(seq)
label_seq_tensor[idx, :seqlen] = torch.LongTensor([1]*seqlen)
label_seq_tensor[idx, :seqlen] = torch.LongTensor(label)
mask[idx, :seqlen] = torch.LongTensor([1] * seqlen)
for idy in range(feature_num):
feature_seq_tensors[idy][idx,:seqlen] = torch.LongTensor(features[idx][:,idy])
Expand Down

0 comments on commit 436abec

Please sign in to comment.