mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-18 21:21:17 +00:00
Propagate documentation modification from rel-1.0.0 (#2713)
This commit is contained in:
parent
c33dab394f
commit
1b85a262fa
3 changed files with 10 additions and 27 deletions
BIN
docs/python/ONNX_Runtime_icon.png
Normal file
BIN
docs/python/ONNX_Runtime_icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
|
|
@ -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 @@ release = version
|
|||
# -- General configuration ---------------------------------------------------
|
||||
|
||||
extensions = [
|
||||
"alabaster",
|
||||
'sphinx.ext.intersphinx',
|
||||
'sphinx.ext.imgmath',
|
||||
'sphinx.ext.ifconfig',
|
||||
|
|
@ -37,6 +31,7 @@ extensions = [
|
|||
'sphinx.ext.githubpages',
|
||||
"sphinx_gallery.gen_gallery",
|
||||
'sphinx.ext.autodoc',
|
||||
'sphinx.ext.graphviz',
|
||||
"pyquickhelper.sphinxext.sphinx_runpython_extension",
|
||||
]
|
||||
|
||||
|
|
@ -48,27 +43,17 @@ source_parsers = {
|
|||
|
||||
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 @@ md_link_replace = {
|
|||
# -- 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")
|
||||
|
|
|
|||
|
|
@ -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())
|
||||
|
|
|
|||
Loading…
Reference in a new issue