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.

sphinx.sh 1.4 kB

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/bash
  2. set -e
  3. # This script can be used to find WARNINGs and ERRORs hide in Python docstring.
  4. #
  5. # * Usually we use Sphinx (https://www.sphinx-doc.org/) and its' tools
  6. # to build HTML documentation for Python projects, such as MegEngine.
  7. #
  8. # * It simulates the process of automatically extracting docstrings from source code
  9. # and try generating HTML pages, just like what MegEngine documentation will do.
  10. #
  11. # Install required Python dependence with pip then you will get following tools:
  12. #
  13. # * sphinx-apidoc: a tool for automatic generation of Sphinx sources that,
  14. # using the autodoc extension, document a whole package in the style of
  15. # other automatic API documentation tools. For more details:
  16. # https://www.sphinx-doc.org/en/master/man/sphinx-apidoc.html
  17. #
  18. # * sphinx-build: generates documentation frome specific files. For more details:
  19. # https://www.sphinx-doc.org/en/master/man/sphinx-build.html
  20. #
  21. # [NOTE]: You need build MegEngine first (target: develop) then run this script.
  22. DOC_PATH=`mktemp -d`
  23. trap 'rm -rf "$DOC_PATH"' EXIT
  24. cd $(dirname $0)/..
  25. python3 -m pip install -r requires.txt
  26. python3 -m pip install -r requires-sphinx.txt
  27. sphinx-apidoc -f -F -e -o $DOC_PATH/source megengine "megengine/core/ops/builtin/*"
  28. PYTHONPATH=. sphinx-build -j auto -c . -W --keep-going \
  29. $DOC_PATH/source $DOC_PATH/build

MegEngine 安装包中集成了使用 GPU 运行代码所需的 CUDA 环境,不用区分 CPU 和 GPU 版。 如果想要运行 GPU 程序,请确保机器本身配有 GPU 硬件设备并安装好驱动。 如果你想体验在云端 GPU 算力平台进行深度学习开发的感觉,欢迎访问 MegStudio 平台