Skip to content

Commit

Permalink
Error fix #4
Browse files Browse the repository at this point in the history
  • Loading branch information
carpedm20 committed Feb 12, 2016
1 parent 58f9dee commit d66e2f1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions batch_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,11 @@ def text_to_tensor(self, input_files, vocab_fname, tensor_fname, char_fname, max
chars.append(char2idx[char])
chars.append(char2idx['}'])

for idx in xrange(min(len(chars), max_word_length)):
output_char[word_num][idx] = chars[idx]

if len(chars) == max_word_length:
chars[-1] = char2idx['}']

for idx in xrange(min(len(chars), max_word_length)):
output_char[word_num][idx] = chars[idx]
word_num += 1

output_tensors.append(output_tensor)
Expand Down

0 comments on commit d66e2f1

Please sign in to comment.