From bbacd811d50c010aa572e03979c9e41e7a3f8a7b Mon Sep 17 00:00:00 2001 From: Happylkx Date: Sat, 16 Jul 2022 10:30:44 +0800 Subject: [PATCH] Correct mistakes in sample code --- docs/en/understand_mmcv/io.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/understand_mmcv/io.md b/docs/en/understand_mmcv/io.md index f6c28dd425..64fbc8b8e6 100644 --- a/docs/en/understand_mmcv/io.md +++ b/docs/en/understand_mmcv/io.md @@ -195,8 +195,8 @@ disk_backend = HardDiskBackend() with io.BytesIO(disk_backend.get(filepath1)) as buffer: checkpoint = torch.load(buffer) with io.BytesIO() as buffer: - torch.save(checkpoint, f) - disk_backend.put(f.getvalue(), filepath2) + torch.save(checkpoint, buffer) + disk_backend.put(buffer.getvalue(), filepath2) ``` If we want to implement an interface which automatically select the corresponding