Skip to content

Commit

Permalink
Update the documentation (open-mmlab#36)
Browse files Browse the repository at this point in the history
* update the documentation

* update the documentation

* Update io.md
  • Loading branch information
Aitical authored and hellock committed Mar 10, 2019
1 parent 76bcbe2 commit b0f4039
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/io.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ with open('test.json', 'r') as f:
data = mmcv.load(f)

# dump data to a string
json_str = mmcv.dump(data, format='json')
json_str = mmcv.dump(data, file_format='json')

# dump data to a file with a filename (infer format from file extension)
mmcv.dump(data, 'out.pkl')

# dump data to a file with a file-like object
with open('test.yaml', 'w') as f:
data = mmcv.dump(data, f, format='yaml')
data = mmcv.dump(data, f, file_format='yaml')
```

It is also very convenient to extend the api to support more file formats.
Expand Down

0 comments on commit b0f4039

Please sign in to comment.