Skip to content

Commit 37544fd

Browse files
committed
documentation
1 parent 2c6ec98 commit 37544fd

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

_doc/tutorial/light_api.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,32 @@ operator `+` to be available as well and that the case. They are
7676
defined in class :class:`Var <onnx_array_api.light_api.Var>` or
7777
:class:`Vars <onnx_array_api.light_api.Vars>` depending on the number of
7878
inputs they require. Their name starts with a lower letter.
79+
80+
Other domains
81+
=============
82+
83+
The following example uses operator *Normalizer* from domain
84+
*ai.onnx.ml*. The operator name is called with the syntax
85+
`<domain>.<operator name>`. The domain may have dots in its name
86+
but it must follow the python definition of a variable.
87+
The operator *Normalizer* becomes `ai.onnx.ml.Normalizer`.
88+
89+
.. runpython::
90+
:showcode:
91+
92+
import numpy as np
93+
from onnx_array_api.light_api import start
94+
from onnx_array_api.plotting.text_plot import onnx_simple_text_plot
95+
96+
model = (
97+
start(opset=19, opsets={"ai.onnx.ml": 3})
98+
.vin("X")
99+
.reshape((-1, 1))
100+
.rename("USE")
101+
.ai.onnx.ml.Normalizer(norm="MAX")
102+
.rename("Y")
103+
.vout()
104+
.to_onnx()
105+
)
106+
107+
print(onnx_simple_text_plot(model))

0 commit comments

Comments
 (0)