tf.io.gfile.copy

Copies data from src to dst.

with open("/tmp/x", "w") as f:
  f.write("asdf")

4
tf.io.gfile.exists("/tmp/x")
True
tf.io.gfile.copy("/tmp/x", "/tmp/y")
tf.io.gfile.exists("/tmp/y")
True
tf.io.gfile.remove("/tmp/y")

You can also specify the URI scheme for selecting a different filesystem:

with open("/tmp/x", "w") as f:
  f.write("asdf")

4
tf.io.gfile.copy("/tmp/x", "file:///tmp/y")
tf.io.gfile.exists("/tmp/y")
True