onnxruntime

Форк
0
129 строк · 3.7 Кб
1
# Copyright (c) Microsoft Corporation. All rights reserved.
2
# Licensed under the MIT License.
3
# pylint: disable=C0103
4

5
"""Configuration file for the Sphinx documentation builder."""
6

7
import os
8
import shutil
9
import sys
10

11
sys.path.append(os.path.join(os.path.dirname(__file__), "..", "_common"))
12

13
# import recommonmark
14

15
# -- Project information -----------------------------------------------------
16

17
project = "Python API"
18
copyright = "2018-2024, Microsoft"
19
author = "Microsoft"
20

21
# -- General configuration ---------------------------------------------------
22

23
extensions = [
24
    "sphinx.ext.intersphinx",
25
    "sphinx.ext.imgmath",
26
    "sphinx.ext.ifconfig",
27
    "sphinx.ext.viewcode",
28
    "sphinx.ext.autodoc",
29
    "sphinx.ext.githubpages",
30
    "sphinx_gallery.gen_gallery",
31
    "sphinx.ext.graphviz",
32
    "pyquickhelper.sphinxext.sphinx_runpython_extension",
33
    "sphinxcontrib.googleanalytics",
34
    "sphinx.ext.napoleon",
35
]
36

37
templates_path = ["_templates"]
38

39
source_parsers = {
40
    ".md": "recommonmark.parser.CommonMarkParser",
41
}
42

43
source_suffix = [".rst"]  # , '.md']
44

45
master_doc = "index"
46
language = "en"
47
exclude_patterns = []
48
pygments_style = "default"
49
autoclass_content = "both"
50
master_doc = "index"
51
onnx_doc_folder = os.path.join(os.path.abspath(os.path.dirname(__file__)), "operators")
52
pygments_style = "sphinx"
53

54
# -- Options for HTML output -------------------------------------------------
55

56
html_logo = "ONNX_Runtime_icon.png"
57
html_static_path = ["_static"]
58
html_theme = "furo"
59
graphviz_output_format = "svg"
60

61
html_context = {
62
    "default_mode": "auto",  # auto: the documentation theme will follow the system default that you have set (light or dark)
63
}
64

65
html_theme_options = {
66
    "collapse_navigation": True,
67
    "external_links": [
68
        {"name": "onnxruntime", "url": "https://onnxruntime.ai/"},
69
        {"name": "github", "url": "https://github.com/microsoft/onnxruntime"},
70
    ],
71
    "github_url": "https://github.com/microsoft/onnxruntime",
72
    "navbar_center": [],
73
    "navigation_depth": 5,
74
    "page_sidebar_items": [],  # default setting is: ["page-toc", "edit-this-page", "sourcelink"],
75
    "show_nav_level": 0,
76
    "show_prev_next": True,
77
    "show_toc_level": 0,
78
    # needed for sphinx 6.0
79
    "logo": {
80
        "text": project,
81
        "image_light": html_logo,
82
        "image_dark": html_logo,
83
        "alt_text": project,
84
    },
85
}
86

87
# -- Options for Google Analytics -------------------------------------------------
88

89
googleanalytics_id = "UA-156955408-1"
90

91
# -- Options for intersphinx extension ---------------------------------------
92

93
# Example configuration for intersphinx: refer to the Python standard library.
94
intersphinx_mapping = {
95
    "python": ("https://docs.python.org/3", None),
96
    "numpy": ("https://numpy.org/doc/stable", None),
97
    "torch": ("https://pytorch.org/docs/stable/", None),
98
}
99

100
# -- Options for Sphinx Gallery ----------------------------------------------
101

102
sphinx_gallery_conf = {
103
    "examples_dirs": "examples",
104
    "gallery_dirs": "auto_examples",
105
}
106

107
# -- markdown options -----------------------------------------------------------
108

109
md_image_dest = "media"
110
md_link_replace = {
111
    "#onnxruntimesessionoptionsenable-profiling)": "#class-onnxruntimesessionoptions)",
112
}
113

114
# -- Setup actions -----------------------------------------------------------
115

116

117
def setup(app):
118
    # download examples for the documentation
119
    this = os.path.abspath(os.path.dirname(__file__))
120
    dest = os.path.join(this, "model.onnx")
121
    if not os.path.exists(dest):
122
        import urllib.request
123

124
        url = "https://raw.githubusercontent.com/onnx/onnx/master/onnx/backend/test/data/node/test_sigmoid/model.onnx"
125
        urllib.request.urlretrieve(url, dest)
126
    loc = os.path.split(dest)[-1]
127
    if not os.path.exists(loc):
128
        shutil.copy(dest, loc)
129
    return app
130

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.