Skip to content

Commit c1efedf

Browse files
committed
first commit
0 parents  commit c1efedf

35 files changed

+8554
-0
lines changed

.gitignore

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
*.pyc
2+
*.pyd
3+
*.dylib
4+
*.so
5+
coverage.html/*
6+
.coverage
7+
dist/*
8+
build/*
9+
*egg-info/*
10+
_doc/auto_examples/*

LICENSE.txt

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2023, Xavier Dupré
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in
11+
all copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.

MANIFEST.in

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
prune _doc
2+
prune _unittests
3+
exclude *.bat
4+
exclude *.yml
5+
exclude *.git*

README.rst

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
.. image:: https://dev.azure.com/xavierdupre3/onnx-array-api/_apis/build/status/sdpython.onnx-array-api
3+
:target: https://dev.azure.com/xavierdupre3/onnx-array-api/
4+
5+
.. image:: https://badge.fury.io/py/onnx-array-api.svg
6+
:target: http://badge.fury.io/py/onnx-array-api
7+
8+
.. image:: http://img.shields.io/github/issues/sdpython/onnx-array-api.png
9+
:alt: GitHub Issues
10+
:target: https://github.com/sdpython/onnx-array-api/issues
11+
12+
.. image:: https://img.shields.io/badge/license-MIT-blue.svg
13+
:alt: MIT License
14+
:target: http://opensource.org/licenses/MIT
15+
16+
.. image:: https://img.shields.io/github/repo-size/sdpython/onnx-array-api
17+
:target: https://github.com/sdpython/onnx-array-api/
18+
:alt: size
19+
20+
onnx-array-api: (Numpy) Array API for ONNX
21+
==========================================
22+
23+
.. image:: https://raw.githubusercontent.com/sdpython/onnx-array-api/main/doc/_static/logo.png
24+
:width: 50
25+
26+
`documentation <http://www.xavierdupre.fr/app/onnx-array-api/helpsphinx/index.html>`_
27+

_doc/_static/logo.png

1008 Bytes
Loading

_doc/api/index.rst

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
===
3+
API
4+
===
5+
6+
.. toctree::
7+
:maxdepth: 1
8+
9+
npx

_doc/api/npx.rst

+202
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
.. _l-npx:
2+
3+
Numpy API for ONNX
4+
==================
5+
6+
See `Python array API standard <https://data-apis.org/array-api/latest/index.html>`_.
7+
8+
.. contents::
9+
:local:
10+
11+
Functions
12+
+++++++++
13+
14+
.. autofunction:: onnx.npx.npx_functions.abs
15+
16+
.. autofunction:: onnx.npx.npx_functions.absolute
17+
18+
.. autofunction:: onnx.npx.npx_functions.arccos
19+
20+
.. autofunction:: onnx.npx.npx_functions.arccosh
21+
22+
.. autofunction:: onnx.npx.npx_functions.amax
23+
24+
.. autofunction:: onnx.npx.npx_functions.amin
25+
26+
.. autofunction:: onnx.npx.npx_functions.arange
27+
28+
.. autofunction:: onnx.npx.npx_functions.argmax
29+
30+
.. autofunction:: onnx.npx.npx_functions.argmin
31+
32+
.. autofunction:: onnx.npx.npx_functions.arcsin
33+
34+
.. autofunction:: onnx.npx.npx_functions.arcsinh
35+
36+
.. autofunction:: onnx.npx.npx_functions.arctan
37+
38+
.. autofunction:: onnx.npx.npx_functions.arctanh
39+
40+
.. autofunction:: onnx.npx.npx_functions.cdist
41+
42+
.. autofunction:: onnx.npx.npx_functions.ceil
43+
44+
.. autofunction:: onnx.npx.npx_functions.clip
45+
46+
.. autofunction:: onnx.npx.npx_functions.compress
47+
48+
.. autofunction:: onnx.npx.npx_functions.compute
49+
50+
.. autofunction:: onnx.npx.npx_functions.concat
51+
52+
.. autofunction:: onnx.npx.npx_functions.cos
53+
54+
.. autofunction:: onnx.npx.npx_functions.cosh
55+
56+
.. autofunction:: onnx.npx.npx_functions.cumsum
57+
58+
.. autofunction:: onnx.npx.npx_functions.det
59+
60+
.. autofunction:: onnx.npx.npx_functions.dot
61+
62+
.. autofunction:: onnx.npx.npx_functions.einsum
63+
64+
.. autofunction:: onnx.npx.npx_functions.erf
65+
66+
.. autofunction:: onnx.npx.npx_functions.exp
67+
68+
.. autofunction:: onnx.npx.npx_functions.expand_dims
69+
70+
.. autofunction:: onnx.npx.npx_functions.expit
71+
72+
.. autofunction:: onnx.npx.npx_functions.floor
73+
74+
.. autofunction:: onnx.npx.npx_functions.hstack
75+
76+
.. autofunction:: onnx.npx.npx_functions.copy
77+
78+
.. autofunction:: onnx.npx.npx_functions.identity
79+
80+
.. autofunction:: onnx.npx.npx_functions.isnan
81+
82+
.. autofunction:: onnx.npx.npx_functions.log
83+
84+
.. autofunction:: onnx.npx.npx_functions.log1p
85+
86+
.. autofunction:: onnx.npx.npx_functions.matmul
87+
88+
.. autofunction:: onnx.npx.npx_functions.pad
89+
90+
.. autofunction:: onnx.npx.npx_functions.reciprocal
91+
92+
.. autofunction:: onnx.npx.npx_functions.relu
93+
94+
.. autofunction:: onnx.npx.npx_functions.round
95+
96+
.. autofunction:: onnx.npx.npx_functions.sigmoid
97+
98+
.. autofunction:: onnx.npx.npx_functions.sign
99+
100+
.. autofunction:: onnx.npx.npx_functions.sin
101+
102+
.. autofunction:: onnx.npx.npx_functions.sinh
103+
104+
.. autofunction:: onnx.npx.npx_functions.squeeze
105+
106+
.. autofunction:: onnx.npx.npx_functions.tan
107+
108+
.. autofunction:: onnx.npx.npx_functions.tanh
109+
110+
.. autofunction:: onnx.npx.npx_functions.topk
111+
112+
.. autofunction:: onnx.npx.npx_functions.transpose
113+
114+
.. autofunction:: onnx.npx.npx_functions.unsqueeze
115+
116+
.. autofunction:: onnx.npx.npx_functions.vstack
117+
118+
.. autofunction:: onnx.npx.npx_functions.where
119+
120+
Var
121+
+++
122+
123+
.. autofunction:: onnx.npx.npx_var.Var
124+
125+
Cst, Input
126+
++++++++++
127+
128+
.. autofunction:: onnx.npx.npx_var.Cst
129+
130+
.. autofunction:: onnx.npx.npx_var.Input
131+
132+
API
133+
+++
134+
135+
.. autofunction:: onnx.npx.npx_core_api.var
136+
137+
.. autofunction:: onnx.npx.npx_core_api.cst
138+
139+
.. autofunction:: onnx.npx.npx_jit_eager.jit_eager
140+
141+
.. autofunction:: onnx.npx.npx_jit_eager.jit_onnx
142+
143+
.. autofunction:: onnx.npx.npx_core_api.make_tuple
144+
145+
.. autofunction:: onnx.npx.npx_core_api.tuple_var
146+
147+
.. autofunction:: onnx.npx.npx_core_api.npxapi_inline
148+
149+
.. autofunction:: onnx.npx.npx_core_api.npxapi_function
150+
151+
JIT, Eager
152+
++++++++++
153+
154+
.. autofunction:: onnx.npx.npx_jit_eager.JitEager
155+
156+
.. autofunction:: onnx.npx.npx_jit_eager.JitOnnx
157+
158+
Tensors
159+
+++++++
160+
161+
.. autofunction:: onnx.npx.npx_tensors.NumpyTensor
162+
163+
Annotations
164+
+++++++++++
165+
166+
.. autofunction:: onnx.npx.npx_types.ElemType
167+
168+
.. autofunction:: onnx.npx.npx_types.ParType
169+
170+
.. autofunction:: onnx.npx.npx_types.OptParType
171+
172+
.. autofunction:: onnx.npx.npx_types.TensorType
173+
174+
.. autofunction:: onnx.npx.npx_types.SequenceType
175+
176+
.. autofunction:: onnx.npx.npx_types.TupleType
177+
178+
.. autofunction:: onnx.npx.npx_types.Bool
179+
180+
.. autofunction:: onnx.npx.npx_types.BFloat16
181+
182+
.. autofunction:: onnx.npx.npx_types.Float16
183+
184+
.. autofunction:: onnx.npx.npx_types.Float32
185+
186+
.. autofunction:: onnx.npx.npx_types.Float64
187+
188+
.. autofunction:: onnx.npx.npx_types.Int8
189+
190+
.. autofunction:: onnx.npx.npx_types.Int16
191+
192+
.. autofunction:: onnx.npx.npx_types.Int32
193+
194+
.. autofunction:: onnx.npx.npx_types.Int64
195+
196+
.. autofunction:: onnx.npx.npx_types.UInt8
197+
198+
.. autofunction:: onnx.npx.npx_types.UInt16
199+
200+
.. autofunction:: onnx.npx.npx_types.UInt32
201+
202+
.. autofunction:: onnx.npx.npx_types.UInt64

_doc/conf.py

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
#!/usr/bin/env python3
2+
# -*- coding: utf-8 -*-
3+
4+
import os
5+
import sys
6+
sys.path.insert(
7+
0,
8+
os.path.abspath(
9+
os.path.join(
10+
os.path.dirname(__file__),
11+
'..')))
12+
from td3a_cpp_deep import __version__ # noqa
13+
14+
extensions = [
15+
'sphinx.ext.autodoc',
16+
'sphinx.ext.intersphinx',
17+
'sphinx.ext.todo',
18+
'sphinx.ext.coverage',
19+
'sphinx.ext.mathjax',
20+
'sphinx.ext.ifconfig',
21+
'sphinx.ext.viewcode',
22+
'sphinx.ext.githubpages',
23+
'sphinx_gallery.gen_gallery',
24+
'alabaster',
25+
'matplotlib.sphinxext.plot_directive',
26+
'pyquickhelper.sphinxext.sphinx_runpython_extension',
27+
'pyquickhelper.sphinxext.sphinx_epkg_extension',
28+
]
29+
30+
templates_path = ['_templates']
31+
html_logo = '_static/logo.png'
32+
source_suffix = '.rst'
33+
master_doc = 'index'
34+
project = 'onnx-array-api'
35+
copyright = '2023, Xavier Dupré'
36+
author = 'Xavier Dupré'
37+
version = __version__
38+
release = __version__
39+
language = 'en'
40+
exclude_patterns = []
41+
pygments_style = 'sphinx'
42+
todo_include_todos = True
43+
44+
html_theme = "furo"
45+
html_theme_path = [alabaster.get_path()]
46+
47+
html_theme_options = {}
48+
html_static_path = ['_static']
49+
50+
51+
intersphinx_mapping = {
52+
"onnx": ("https://onnx.ai/onnx/", None),
53+
"matplotlib": ("https://matplotlib.org/", None),
54+
"numpy": ("https://numpy.org/doc/stable", None),
55+
"pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None),
56+
"python": (f"https://docs.python.org/{sys.version_info.major}", None),
57+
"scipy": ("https://docs.scipy.org/doc/scipy/reference", None),
58+
"torch": ("https://pytorch.org/docs/stable/", None),
59+
}
60+
61+
sphinx_gallery_conf = {
62+
# path to your examples scripts
63+
'examples_dirs': os.path.join(os.path.dirname(__file__), 'examples'),
64+
# path where to save gallery generated examples
65+
'gallery_dirs': 'auto_examples'
66+
}
67+
68+
epkg_dictionary = {
69+
'JIT': 'https://en.wikipedia.org/wiki/Just-in-time_compilation',
70+
'onnx': 'https://onnx.ai/onnx/',
71+
'ONNX': 'https://onnx.ai/',
72+
'onnxruntime': 'https://onnxruntime.ai/',
73+
'numpy': 'https://numpy.org/',
74+
'numba': 'https://numba.pydata.org/',
75+
'python': 'https://www.python.org/',
76+
'scikit-learn': 'https://scikit-learn.org/stable/',
77+
'sphinx-gallery': 'https://github.com/sphinx-gallery/sphinx-gallery',
78+
'torch': 'https://pytorch.org/docs/stable/torch.html',
79+
}

_doc/examples/README.txt

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Example gallery
2+
===============
3+
4+
A couple of examples to illustrate different implementation
5+
of dot product (see also :epkg:`sphinx-gallery`).
6+
7+
8+
9+
10+
11+

0 commit comments

Comments
 (0)