Skip to content

Commit

Permalink
write attention debug to log file (OpenNMT#1384)
Browse files Browse the repository at this point in the history
  • Loading branch information
awavefunction authored and vince62s committed Apr 5, 2019
1 parent ad50970 commit 19b52ec
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion onmt/translate/translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,10 @@ def translate(
"{:*>10.7f} ", "{:>10.7f} ", max_index)
output += row_format.format(word, *row) + '\n'
row_format = "{:>10.10} " + "{:>10.7f} " * len(srcs)
os.write(1, output.encode('utf-8'))
if self.logger:
self.logger.info(output)
else:
os.write(1, output.encode('utf-8'))

end_time = time.time()

Expand Down

0 comments on commit 19b52ec

Please sign in to comment.