Skip to content

Commit

Permalink
[ONNX 3] Add ONNX registry tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
titaiwangms committed Sep 20, 2023
1 parent 9867f0e commit 3a17a30
Show file tree
Hide file tree
Showing 12 changed files with 476 additions and 3 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _static/img/onnx/custom_addandround_model.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _static/img/onnx/custom_aten_add_function.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _static/img/onnx/custom_aten_add_model.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _static/img/onnx/custom_aten_gelu_function.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _static/img/onnx/custom_aten_gelu_model.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions beginner_source/onnx/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ ONNX
2. export_simple_model_to_onnx_tutorial.py
Export a PyTorch model to ONNX
https://pytorch.org/tutorials/beginner/onnx/export_simple_model_to_onnx_tutorial.html

3. onnx_registry_tutorial.py
Introduction to ONNX
https://pytorch.org/tutorials/beginner/onnx/onnx_registry_tutorial.html
3 changes: 2 additions & 1 deletion beginner_source/onnx/export_simple_model_to_onnx_tutorial.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
"""
`Introduction to ONNX <intro_onnx.html>`_ ||
**Export a PyTorch model to ONNX**
**Export a PyTorch model to ONNX** ||
`Introduction to ONNX Registry <onnx_registry_tutorial.html>`_
Export a PyTorch model to ONNX
==============================
Expand Down
11 changes: 10 additions & 1 deletion beginner_source/onnx/intro_onnx.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
**Introduction to ONNX** ||
`Export a PyTorch model to ONNX <export_simple_model_to_onnx_tutorial.html>`_
`Export a PyTorch model to ONNX <export_simple_model_to_onnx_tutorial.html>`_ ||
`Introduction to ONNX Registry <onnx_registry_tutorial.html>`_
Introduction to ONNX
====================
Expand Down Expand Up @@ -32,13 +33,21 @@
Dependencies
------------
PyTorch 2.1.0 or newer is required.
The ONNX exporter depends on extra Python packages:
- `ONNX <https://onnx.ai>`_
- `ONNX Script <https://onnxscript.ai>`_
They can be installed through `pip <https://pypi.org/project/pip/>`_:
.. note::
This tutorial leverages `onnxscript <https://github.com/microsoft/onnxscript#readme>`__
to create custom ONNX operators. onnxscript is a Python library that allows users to
create custom ONNX operators in Python. It is a prerequisite learning material for
this tutorial. Please make sure you have read the onnxscript tutorial before proceeding.
.. code-block:: bash
pip install --upgrade onnx onnxscript
Expand Down
Loading

0 comments on commit 3a17a30

Please sign in to comment.