Skip to content
This repository was archived by the owner on Jan 21, 2025. It is now read-only.

Commit da90793

Browse files
author
Mesh TensorFlow Team
committed
Use %g instead of %f for printing in mesh_tensorflow/transformer/utils.py.
This prevents truncation for tiny floats. PiperOrigin-RevId: 372389724
1 parent ac6e337 commit da90793

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mesh_tensorflow/transformer/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1612,7 +1612,7 @@ def save_scores(results, vocabulary,
16121612
scores = [r["scores"] for r in results]
16131613

16141614
if scores_filename is not None:
1615-
write_lines_to_file(["%f" % f for f in scores], scores_filename+".scores")
1615+
write_lines_to_file(["%g" % f for f in scores], scores_filename+".scores")
16161616

16171617
if save_example_text:
16181618
results = _maybe_add_pretokenized_features(results, vocabulary)

0 commit comments

Comments
 (0)