mirror of
https://github.com/wassname/ray.git
synced 2026-10-28 13:21:06 +08:00
[tune] os.replace() instead of os.rename() for cross-platform (#9141)
Co-authored-by: Mehrdad <noreply@github.com>
This commit is contained in:
1 parent
0bfcc2e5ba
commit
07655036d2
1 file changed
+1
-1
@@ -276,7 +276,7 @@ class TrialRunner:
|
||||
with open(tmp_file_name, "w") as f:
|
||||
json.dump(runner_state, f, indent=2, cls=_TuneFunctionEncoder)
|
||||
|
||||
os.rename(tmp_file_name, self.checkpoint_file)
|
||||
os.replace(tmp_file_name, self.checkpoint_file)
|
||||
if force:
|
||||
self._syncer.sync_up()
|
||||
else:
|
||||
|
||||
Reference in new issue
Block a user