Unverified Commit 75ae2009 authored by Happylkx's avatar Happylkx Committed by GitHub
Browse files

[Docs] Correct mistakes of examples (#2120)

parent f4167fe1
...@@ -195,8 +195,8 @@ disk_backend = HardDiskBackend() ...@@ -195,8 +195,8 @@ disk_backend = HardDiskBackend()
with io.BytesIO(disk_backend.get(filepath1)) as buffer: with io.BytesIO(disk_backend.get(filepath1)) as buffer:
checkpoint = torch.load(buffer) checkpoint = torch.load(buffer)
with io.BytesIO() as buffer: with io.BytesIO() as buffer:
torch.save(checkpoint, f) torch.save(checkpoint, buffer)
disk_backend.put(f.getvalue(), filepath2) disk_backend.put(buffer.getvalue(), filepath2)
``` ```
If we want to implement an interface which automatically select the corresponding If we want to implement an interface which automatically select the corresponding
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment