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

Commit a54f5cf

Browse files
katelee168Mesh TensorFlow Team
authored andcommitted
Make directory if it doesn't exist.
PiperOrigin-RevId: 378658687
1 parent 5c866ff commit a54f5cf

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

mesh_tensorflow/transformer/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1371,6 +1371,7 @@ def write_lines_to_file(lines, filename):
13711371
"""
13721372
if tf.io.gfile.exists(filename):
13731373
tf.io.gfile.remove(filename)
1374+
tf.io.gfile.makedirs(os.path.dirname(filename))
13741375
with tf.io.gfile.GFile(filename, "w") as output_file:
13751376
for line in lines:
13761377
output_file.write("{}\n".format(str(line).replace("\n", " ")))

0 commit comments

Comments
 (0)