|
1 | 1 | """
|
2 | 2 | **Introduction to ONNX** ||
|
3 |
| -`Export a PyTorch model to ONNX <export_simple_model_to_onnx_tutorial.html>`_ || |
4 |
| -`Introduction to ONNX Registry <onnx_registry_tutorial.html>`_ |
| 3 | +`Exporting a PyTorch model to ONNX <export_simple_model_to_onnx_tutorial.html>`_ || |
| 4 | +`Extending the ONNX Registry <onnx_registry_tutorial.html>`_ |
5 | 5 |
|
6 | 6 | Introduction to ONNX
|
7 | 7 | ====================
|
|
37 | 37 |
|
38 | 38 | The ONNX exporter depends on extra Python packages:
|
39 | 39 |
|
40 |
| - - `ONNX <https://onnx.ai>`_ |
41 |
| - - `ONNX Script <https://onnxscript.ai>`_ |
| 40 | + - `ONNX <https://onnx.ai>`_ standard library |
| 41 | + - `ONNX Script <https://onnxscript.ai>`_ library that enables developers to author ONNX operators, |
| 42 | + functions and models using a subset of Python in an expressive, and yet simple fashion. |
42 | 43 |
|
43 | 44 | They can be installed through `pip <https://pypi.org/project/pip/>`_:
|
44 | 45 |
|
45 |
| -.. note:: |
46 |
| - This tutorial leverages `onnxscript <https://github.com/microsoft/onnxscript#readme>`__ |
47 |
| - to create custom ONNX operators. onnxscript is a Python library that allows users to |
48 |
| - create custom ONNX operators in Python. It is a prerequisite learning material for |
49 |
| - this tutorial. Please make sure you have read the onnxscript tutorial before proceeding. |
50 |
| -
|
51 | 46 | .. code-block:: bash
|
52 | 47 |
|
53 | 48 | pip install --upgrade onnx onnxscript
|
54 | 49 |
|
| 50 | +To validate the installation, run the following commands: |
| 51 | +
|
| 52 | +.. code-block:: python |
| 53 | +
|
| 54 | + import torch |
| 55 | + print(torch.__version__) |
| 56 | +
|
| 57 | + import onnxscript |
| 58 | + print(onnxscript.__version__) |
| 59 | +
|
| 60 | + from onnxscript import opset18 # opset 18 is the latest (and only) supported version for now |
| 61 | +
|
| 62 | + import onnxruntime |
| 63 | + print(onnxruntime.__version__) |
| 64 | +
|
| 65 | +Each `import` must succeed without any errors and the library versions must be printed out. |
| 66 | +
|
55 | 67 | Further reading
|
56 | 68 | ---------------
|
57 | 69 |
|
|
0 commit comments