Skip to content
9 changes: 4 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ onnx-array-api: APIs to create ONNX Graphs

**onnx-array-api** implements APIs to create custom ONNX graphs.
The objective is to speed up the implementation of converter libraries.
The library is released on
`pypi/onnx-array-api <https://pypi.org/project/onnx-array-api/>`_
and its documentation is published at
`APIs to create ONNX Graphs <https://sdpython.github.io/doc/onnx-array-api/dev/>`_.

Numpy API
+++++++++
Expand Down Expand Up @@ -147,11 +151,6 @@ The euclidean distance looks like the following:
.to_onnx()
)

The library is released on
`pypi/onnx-array-api <https://pypi.org/project/onnx-array-api/>`_
and its documentation is published at
`APIs to create ONNX Graphs <https://sdpython.github.io/doc/onnx-array-api/dev/>`_.

GraphBuilder API
++++++++++++++++

Expand Down
1 change: 1 addition & 0 deletions _doc/examples/plot_onnx_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,6 @@
print(text)

###############################
# See :ref:`l-long-output-compare_onnx_execution` for a better view.
# The display shows that ReduceSumSquare was replaced by Mul + ReduceSum,
# and ReduceLogSumExp by ReduceMax + Sub + Exp + Log + Add.
1 change: 1 addition & 0 deletions _doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ The objective is to speed up the implementation of converter libraries.

CHANGELOGS
license
long_outputs

Sources available on
`github/onnx-array-api <https://github.com/sdpython/onnx-array-api>`_.
Expand Down
50 changes: 50 additions & 0 deletions _doc/long_outputs.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
:hide-toc:

==========================
Long outputs uneasy to see
==========================

.. contents::
:local:

onnx
====

.. _l-long-output-compare_onnx_execution:

onnx_array_api.reference.compare_onnx_execution
+++++++++++++++++++++++++++++++++++++++++++++++

From example :ref:`l-onnx-diff-example` for function
:func:`onnx_array_api.reference.compare_onnx_execution`.
See also `raw rendering <https://github.com/sdpython/onnx-array-api/blob/main/_doc/long_outputs.rst#onnx_array_apireferencecompare_onnx_execution>`_.

::

1 = | INITIA float64 1 HAAA Ad_Addcst | INITIA float64 1 HAAA Ad_Addcst
2 = | INITIA float64 4x4 ADZF Ge_Gemmcst | INITIA float64 4x4 ADZF Ge_Gemmcst
3 = | INITIA float64 4 USEA Ge_Gemmcst1 | INITIA float64 4 USEA Ge_Gemmcst1
4 = | INITIA float64 1 AAAA Mu_Mulcst | INITIA float64 1 AAAA Mu_Mulcst
5 = | INITIA float64 1 DAAA Ad_Addcst1 | INITIA float64 1 DAAA Ad_Addcst1
6 = | INITIA float64 1 AAAA Ad_Addcst2 | INITIA float64 1 AAAA Ad_Addcst2
7 = | INPUT float64 1x4 AAAA X | INPUT float64 1x4 AAAA X
8 = | RESULT float64 1x4 UTFC Gemm Ge_Y0 | RESULT float64 1x4 UTFC Gemm Ge_Y0
9 + | | RESULT float64 1x4 TIEG Mul Mu_C01
10 ~ | RESULT float64 1x1 NAAA ReduceSumS Re_reduced0 | RESULT float64 1x1 NAAA ReduceSum Re_reduced0
11 = | RESULT float64 1x1 NAAA Concat Co_concat_re | RESULT float64 1x1 NAAA Concat Co_concat_re
12 = | RESULT float64 1x1 UAAA Add Ad_C02 | RESULT float64 1x1 UAAA Add Ad_C02
13 = | RESULT float64 1x1 DAAA Mul Mu_C0 | RESULT float64 1x1 DAAA Mul Mu_C0
14 = | RESULT float64 1x1 GAAA Add Ad_C01 | RESULT float64 1x1 GAAA Add Ad_C01
15 = | RESULT float64 1x1 GAAA Add Ad_C0 | RESULT float64 1x1 GAAA Add Ad_C0
16 = | RESULT int64 1x1 AAAA ArgMax label | RESULT int64 1x1 AAAA ArgMax label
17 + | | RESULT float64 1x1 GAAA ReduceMax Re_reduced03
18 + | | RESULT float64 1x1 AAAA Sub Su_C01
19 + | | RESULT float64 1x1 BAAA Exp Ex_output0
20 + | | RESULT float64 1x1 BAAA ReduceSum Re_reduced02
21 + | | RESULT float64 1x1 AAAA Log Lo_output0
22 ~ | RESULT float64 1x1 GAAA ReduceLogS score_sample | RESULT float64 1x1 GAAA Add score_sample
23 = | RESULT float64 1x1 AAAA Sub Su_C0 | RESULT float64 1x1 AAAA Sub Su_C0
24 = | RESULT float64 1x1 BAAA Exp probabilitie | RESULT float64 1x1 BAAA Exp probabilitie
25 = | OUTPUT int64 1x1 AAAA label | OUTPUT int64 1x1 AAAA label
26 = | OUTPUT float64 1x1 BAAA probabilitie | OUTPUT float64 1x1 BAAA probabilitie
27 = | OUTPUT float64 1x1 GAAA score_sample | OUTPUT float64 1x1 GAAA score_sample
1 change: 1 addition & 0 deletions _unittests/onnx-numpy-skips.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# API failures
# see https://github.com/data-apis/array-api-tests/blob/master/numpy-skips.txt
# uses __setitem__
array_api_tests/test_creation_functions.py::test_arange
array_api_tests/test_creation_functions.py::test_asarray_arrays
array_api_tests/test_creation_functions.py::test_empty
array_api_tests/test_creation_functions.py::test_empty_like
Expand Down
14 changes: 7 additions & 7 deletions _unittests/ut_reference/test_evaluator_yield.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,13 +422,13 @@ def test_distance_sequence_str(self):
text = dc.to_str(s1, s2, align)
self.assertIn("OUTPUT", text)
expected = """
1=|INPUTfloat322x2ABCDA|INPUTfloat322x2ABCDA
2=|INPUTfloat322x2ABCDB|INPUTfloat322x2ABCDB
3~|INPUTfloat322x3ABCDX|INPUTfloat322x2ABCDX
4-|RESULTfloat322x2CEIOExpH|
5=|RESULTfloat322x2CEIOLinearRegrY1|RESULTfloat322x2CEIOLinearRegrY1
6~|RESULTfloat322x2CEIOAbsY|RESULTfloat322x3CEIPAbsZ
7~|OUTPUTfloat322x2CEIOY|OUTPUTfloat322x2CEIPY
001=|INPUTfloat322x2ABCDA|INPUTfloat322x2ABCDA
002=|INPUTfloat322x2ABCDB|INPUTfloat322x2ABCDB
003~|INPUTfloat322x3ABCDX|INPUTfloat322x2ABCDX
004-|RESULTfloat322x2CEIOExpH|
005=|RESULTfloat322x2CEIOLinearRegrY1|RESULTfloat322x2CEIOLinearRegrY1
006~|RESULTfloat322x2CEIOAbsY|RESULTfloat322x3CEIPAbsZ
007~|OUTPUTfloat322x2CEIOY|OUTPUTfloat322x2CEIPY
""".replace(
" ", ""
).strip(
Expand Down
2 changes: 1 addition & 1 deletion onnx_array_api/reference/evaluator_yield.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ def to_str(
else:
d1 = s1[i]
line = f"- | {_align(str(d1), column_size)} | {_align('', column_size)}"
rows.append(f"{row_index: 3d} {line}")
rows.append(f"{row_index:03d} {line}")
last = i, j
row_index += 1
return "\n".join(rows)
Expand Down