message: Issue:#46004
  Context:
  Initial changes resulted in merge conflicts. As a result,I had to
  come up with a different approach since _SHARDED_SUFFIX is a tensor now.
  Solution:
  Add os.path.normpath function to _temp/part instead
diff: @@ -53,7 +53,6 @@ from tensorflow.python.training import training_util
  from tensorflow.python.training.checkpoint_state_pb2 import CheckpointState
  from tensorflow.python.util import compat
  -
  # Op names which identify variable reads which should be saved.
  _VARIABLE_OPS = set(["Variable",
  "VariableV2",
  @@ -247,6 +246,7 @@ class BaseSaverBuilder(object):
  [spec.tensor.dtype])[0])
  return tensors
  +
  # pylint: enable=unused-argument
  def sharded_filename(self, filename_tensor, shard, num_shards):
  @@ -299,6 +299,8 @@ class BaseSaverBuilder(object):
  # Transformations:
  # * Users pass in "save_path" in save() and restore(). Say "myckpt".
  # * checkpoint_prefix gets fed <save_path><_SHARDED_SUFFIX>.
  + # * If checkpoint_prefix is a S3 bucket path ".part" is appended to it
  + # * Otherwise _temp/part is appended which is normalized relative to the OS
  #
  # Example:
  # During runtime, a temporary directory is first created, which contains
  @@ -317,7 +319,11 @@ class BaseSaverBuilder(object):
  # prefix directly, instead of any physical pathname. (On failure and
  # subsequent restore, an outdated and orphaned temporary directory can be
  # safely removed.)
  - _SHARDED_SUFFIX = os.path.normpath("_temp_%s/part" % uuid.uuid4().hex)
  + with ops.device("CPU"):
  + _SHARDED_SUFFIX = array_ops.where(
  + string_ops.regex_full_match(checkpoint_prefix, "^s3://.*"),
  + constant_op.constant(".part"),
  + constant_op.constant(os.path.normpath("_temp/part")))
  tmp_checkpoint_prefix = string_ops.string_join(
  [checkpoint_prefix, _SHARDED_SUFFIX])
  