diff --git a/docs/python/ONNX_Runtime_icon.png b/docs/python/ONNX_Runtime_icon.png new file mode 100644 index 0000000000000..90c6e574bab21 Binary files /dev/null and b/docs/python/ONNX_Runtime_icon.png differ diff --git a/docs/python/conf.py b/docs/python/conf.py index 78c7574ba70b4..7e44670218380 100644 --- a/docs/python/conf.py +++ b/docs/python/conf.py @@ -8,15 +8,8 @@ import os import sys import shutil -import warnings -# Check these extensions were installed. -import sphinx_gallery.gen_gallery -# The package should be installed in a virtual environment. import onnxruntime -# markdown output: it requires two extensions available at: -# https://github.com/xadupre/sphinx-docfx-yaml -# https://github.com/xadupre/sphinx-docfx-markdown -import recommonmark +# import recommonmark # -- Project information ----------------------------------------------------- @@ -29,6 +22,7 @@ # -- General configuration --------------------------------------------------- extensions = [ + "alabaster", 'sphinx.ext.intersphinx', 'sphinx.ext.imgmath', 'sphinx.ext.ifconfig', @@ -37,6 +31,7 @@ 'sphinx.ext.githubpages', "sphinx_gallery.gen_gallery", 'sphinx.ext.autodoc', + 'sphinx.ext.graphviz', "pyquickhelper.sphinxext.sphinx_runpython_extension", ] @@ -48,27 +43,17 @@ source_suffix = ['.rst'] # , '.md'] -# enables markdown output -try: - import docfx_markdown - extensions.extend([ - "docfx_yaml.extension", - "docfx_markdown", - ]) - source_suffix.append('md') -except ImportError: - warnings.warn("markdown output is not available") - master_doc = 'index' language = "en" exclude_patterns = [] -pygments_style = 'sphinx' +pygments_style = 'default' # -- Options for HTML output ------------------------------------------------- -html_theme = "pyramid" -html_logo = "../ONNX_Runtime_icon.png" +html_theme = "alabaster" +html_logo = "ONNX_Runtime_icon.png" html_static_path = ['_static'] +graphviz_output_format = "svg" # -- Options for intersphinx extension --------------------------------------- @@ -92,10 +77,6 @@ # -- Setup actions ----------------------------------------------------------- def setup(app): - # Placeholder to initialize the folder before - # generating the documentation. - app.add_stylesheet('_static/gallery.css') - # download examples for the documentation this = os.path.abspath(os.path.dirname(__file__)) dest = os.path.join(this, "model.onnx") diff --git a/docs/python/tutorial.rst b/docs/python/tutorial.rst index 8bfd7f46a24c1..d00a378cfeedc 100644 --- a/docs/python/tutorial.rst +++ b/docs/python/tutorial.rst @@ -21,6 +21,8 @@ In this tutorial, we will briefly create a pipeline with *scikit-learn*, convert it into ONNX format and run the first predictions. +.. _l-logreg-example: + Step 1: Train a model using your favorite framework +++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -61,7 +63,7 @@ to convert other model formats into ONNX. Here we will use from skl2onnx import convert_sklearn from skl2onnx.common.data_types import FloatTensorType - initial_type = [('float_input', FloatTensorType([1, 4]))] + initial_type = [('float_input', FloatTensorType([None, 4]))] onx = convert_sklearn(clr, initial_types=initial_type) with open("logreg_iris.onnx", "wb") as f: f.write(onx.SerializeToString())