2018-11-20 00:48:22 +00:00
|
|
|
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
|
|
|
# Licensed under the MIT License.
|
|
|
|
|
|
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
#
|
|
|
|
|
# Configuration file for the Sphinx documentation builder.
|
|
|
|
|
|
|
|
|
|
import os
|
|
|
|
|
import shutil
|
2022-04-26 16:35:16 +00:00
|
|
|
import sys
|
|
|
|
|
|
2018-11-20 00:48:22 +00:00
|
|
|
import onnxruntime
|
2022-04-26 16:35:16 +00:00
|
|
|
|
2019-12-20 23:25:45 +00:00
|
|
|
# import recommonmark
|
2018-11-20 00:48:22 +00:00
|
|
|
|
|
|
|
|
# -- Project information -----------------------------------------------------
|
|
|
|
|
|
2022-04-26 16:35:16 +00:00
|
|
|
project = "ONNX Runtime"
|
2023-01-21 17:50:56 +00:00
|
|
|
copyright = "2018-2023, Microsoft"
|
2022-04-26 16:35:16 +00:00
|
|
|
author = "Microsoft"
|
2018-11-20 00:48:22 +00:00
|
|
|
version = onnxruntime.__version__
|
|
|
|
|
release = version
|
|
|
|
|
|
|
|
|
|
# -- General configuration ---------------------------------------------------
|
|
|
|
|
|
|
|
|
|
extensions = [
|
2019-12-20 23:25:45 +00:00
|
|
|
"alabaster",
|
2022-04-26 16:35:16 +00:00
|
|
|
"sphinx.ext.intersphinx",
|
|
|
|
|
"sphinx.ext.imgmath",
|
|
|
|
|
"sphinx.ext.ifconfig",
|
|
|
|
|
"sphinx.ext.viewcode",
|
2018-11-20 00:48:22 +00:00
|
|
|
"sphinx.ext.autodoc",
|
2022-04-26 16:35:16 +00:00
|
|
|
"sphinx.ext.githubpages",
|
2018-11-20 00:48:22 +00:00
|
|
|
"sphinx_gallery.gen_gallery",
|
2022-04-26 16:35:16 +00:00
|
|
|
"sphinx.ext.graphviz",
|
2018-12-05 18:12:25 +00:00
|
|
|
"pyquickhelper.sphinxext.sphinx_runpython_extension",
|
2022-12-09 23:44:12 +00:00
|
|
|
"sphinxcontrib.googleanalytics",
|
2018-11-20 00:48:22 +00:00
|
|
|
]
|
|
|
|
|
|
2022-04-26 16:35:16 +00:00
|
|
|
templates_path = ["_templates"]
|
2018-11-20 00:48:22 +00:00
|
|
|
|
|
|
|
|
source_parsers = {
|
2022-04-26 16:35:16 +00:00
|
|
|
".md": "recommonmark.parser.CommonMarkParser",
|
2018-11-20 00:48:22 +00:00
|
|
|
}
|
|
|
|
|
|
2022-04-26 16:35:16 +00:00
|
|
|
source_suffix = [".rst"] # , '.md']
|
2019-01-11 11:41:42 +00:00
|
|
|
|
2022-04-26 16:35:16 +00:00
|
|
|
master_doc = "index"
|
2018-11-20 00:48:22 +00:00
|
|
|
language = "en"
|
|
|
|
|
exclude_patterns = []
|
2022-04-26 16:35:16 +00:00
|
|
|
pygments_style = "default"
|
|
|
|
|
autoclass_content = "both"
|
2018-11-20 00:48:22 +00:00
|
|
|
|
|
|
|
|
# -- Options for HTML output -------------------------------------------------
|
|
|
|
|
|
2019-12-20 23:25:45 +00:00
|
|
|
html_theme = "alabaster"
|
|
|
|
|
html_logo = "ONNX_Runtime_icon.png"
|
2022-04-26 16:35:16 +00:00
|
|
|
html_static_path = ["_static"]
|
2019-12-20 23:25:45 +00:00
|
|
|
graphviz_output_format = "svg"
|
2018-11-20 00:48:22 +00:00
|
|
|
|
2022-12-09 23:44:12 +00:00
|
|
|
# -- Options for Google Analytics -------------------------------------------------
|
|
|
|
|
|
|
|
|
|
googleanalytics_id = "UA-156955408-1"
|
|
|
|
|
|
2018-11-20 00:48:22 +00:00
|
|
|
# -- Options for intersphinx extension ---------------------------------------
|
|
|
|
|
|
|
|
|
|
# Example configuration for intersphinx: refer to the Python standard library.
|
2022-04-26 16:35:16 +00:00
|
|
|
intersphinx_mapping = {"https://docs.python.org/": None}
|
2018-11-20 00:48:22 +00:00
|
|
|
|
|
|
|
|
# -- Options for Sphinx Gallery ----------------------------------------------
|
|
|
|
|
|
|
|
|
|
sphinx_gallery_conf = {
|
2022-04-26 16:35:16 +00:00
|
|
|
"examples_dirs": "examples",
|
|
|
|
|
"gallery_dirs": "auto_examples",
|
2018-11-20 00:48:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# -- markdown options -----------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
md_image_dest = "media"
|
|
|
|
|
md_link_replace = {
|
2022-04-26 16:35:16 +00:00
|
|
|
"#onnxruntimesessionoptionsenable-profiling)": "#class-onnxruntimesessionoptions)",
|
2018-11-20 00:48:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# -- Setup actions -----------------------------------------------------------
|
|
|
|
|
|
2022-04-26 16:35:16 +00:00
|
|
|
|
2018-11-20 00:48:22 +00:00
|
|
|
def setup(app):
|
2018-12-05 18:12:25 +00:00
|
|
|
# download examples for the documentation
|
|
|
|
|
this = os.path.abspath(os.path.dirname(__file__))
|
|
|
|
|
dest = os.path.join(this, "model.onnx")
|
|
|
|
|
if not os.path.exists(dest):
|
|
|
|
|
import urllib.request
|
2022-04-26 16:35:16 +00:00
|
|
|
|
|
|
|
|
url = "https://raw.githubusercontent.com/onnx/onnx/master/onnx/backend/test/data/node/test_sigmoid/model.onnx"
|
2018-12-05 18:12:25 +00:00
|
|
|
urllib.request.urlretrieve(url, dest)
|
|
|
|
|
loc = os.path.split(dest)[-1]
|
|
|
|
|
if not os.path.exists(loc):
|
|
|
|
|
import shutil
|
2022-04-26 16:35:16 +00:00
|
|
|
|
2018-12-05 18:12:25 +00:00
|
|
|
shutil.copy(dest, loc)
|
2018-11-20 00:48:22 +00:00
|
|
|
return app
|