You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 1.5 kB

12345678910111213141516171819202122232425262728293031323334353637
  1. ## maintain docs
  2. 1. build docs
  3. ```shell
  4. # in root directory:
  5. make docs
  6. ```
  7. 2. doc string format
  8. We adopt the google style docstring format as the standard, please refer to the following documents.
  9. 1. Google Python style guide docstring [link](http://google.github.io/styleguide/pyguide.html#381-docstrings)
  10. 2. Google docstring example [link](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html)
  11. 3. sample:torch.nn.modules.conv [link](https://pytorch.org/docs/stable/_modules/torch/nn/modules/conv.html#Conv1d)
  12. 4. load function as an example:
  13. ```python
  14. def load(file, file_format=None, **kwargs):
  15. """Load data from json/yaml/pickle files.
  16. This method provides a unified api for loading data from serialized files.
  17. Args:
  18. file (str or :obj:`Path` or file-like object): Filename or a file-like
  19. object.
  20. file_format (str, optional): If not specified, the file format will be
  21. inferred from the file extension, otherwise use the specified one.
  22. Currently supported formats include "json", "yaml/yml".
  23. Examples:
  24. >>> load('/path/of/your/file') # file is storaged in disk
  25. >>> load('https://path/of/your/file') # file is storaged in Internet
  26. >>> load('oss://path/of/your/file') # file is storaged in petrel
  27. Returns:
  28. The content from the file.
  29. """
  30. ```