Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/python/ONNX_Runtime_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 7 additions & 26 deletions docs/python/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 -----------------------------------------------------

Expand All @@ -29,6 +22,7 @@
# -- General configuration ---------------------------------------------------

extensions = [
"alabaster",
'sphinx.ext.intersphinx',
'sphinx.ext.imgmath',
'sphinx.ext.ifconfig',
Expand All @@ -37,6 +31,7 @@
'sphinx.ext.githubpages',
"sphinx_gallery.gen_gallery",
'sphinx.ext.autodoc',
'sphinx.ext.graphviz',
"pyquickhelper.sphinxext.sphinx_runpython_extension",
]

Expand All @@ -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 ---------------------------------------

Expand All @@ -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")
Expand Down
4 changes: 3 additions & 1 deletion docs/python/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
+++++++++++++++++++++++++++++++++++++++++++++++++++

Expand Down Expand Up @@ -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())
Expand Down