Skip to content

Commit 517a9c5

Browse files
committed
code comment --> nlp/read_words
1 parent d0d5d1c commit 517a9c5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tensorlayer/nlp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,9 +415,9 @@ def read_words(filename="nietzsche.txt", replace = ['\n', '<eos>']):
415415
- `tensorflow.models.rnn.ptb.reader <https://github.com/tensorflow/tensorflow/tree/master/tensorflow/models/rnn/ptb>`_
416416
"""
417417
with tf.gfile.GFile(filename, "r") as f:
418-
try:
418+
try: # python 3.4 or older
419419
context_list = f.read().replace(*replace).split()
420-
except:
420+
except: # python 3.5
421421
replace = [x.encode('utf-8') for x in replace]
422422
context_list = f.read().replace(*replace).split()
423423
return context_list

0 commit comments

Comments
 (0)