41 Commits

Author SHA1 Message Date
Christian Bourjau 8bd4ddc60e Fix warnings from docs-build and ensure we fail on warnings in the future (#8294)
This will turn our docs build job red (see first commit) if there are
any broken internal anchors etc. Repository-links in the markdown files
are re-written on-the-fly to urls pointing to the appropriate file on
github.com (all those links are currently broken in the docs hosted on
onnx.ai).

Related to #8291

---------

Signed-off-by: Christian Bourjau <christian.bourjau@quantco.com>
2026-08-12 15:36:00 +02:00
Christian Bourjau 1f26081552 Execute code snippets in PythonAPIOverview.md (+ fixes) (#7856)
The code snippets in `PythonAPIOverview.md` are currently not executed.
Instead, there were some (broken) links to jupyter notebooks that
essentially contained copies of the example code.

This PR removes this redundancy and executes code snippets directly
where it makes sense. The notebooks are removed since they provided very
little further utility and are not referenced from elsewhere. The
snippet working on a "Pad" node was actually broken and is fixed in this
PR.

In the larger picture, this entire file should probably be removed.
Instead, this information should be moved to the docstrings for the
respective functions which is already more prominently exposed in the
docs. Nonetheless, this PR seems like a reasonable stopgap-solution,
IMHO.

Signed-off-by: Christian Bourjau <christian.bourjau@quantco.com>
Co-authored-by: Andreas Fehlner <fehlner@arcor.de>
2026-05-03 04:49:04 +02:00
Chessing234 c7e25b155b Fix documentation typos and grammar errors in API docs (#7809)
### Motivation and Context

Fixes several documentation typos and grammar errors found in the Python
API documentation:

1. **`docs/PythonAPIOverview.md`**: "Please checker onnx.helper" →
"Please check onnx.helper"
2. **`docs/docsgen/source/api/index.md`**: "modifying one them" →
"modifying one of them"
3. **`docs/docsgen/source/api/index.md`**: "An ONNX model can be
directly from" → "An ONNX model can be created directly from"

These are small but affect the readability of the official
documentation.

Signed-off-by: Chessing234 <Chessing234@users.noreply.github.com>
Signed-off-by: Taksh <takshkothari09@gmail.com>
2026-04-14 03:04:00 +00:00
Yuanyuan Chen 29a009c2ef Improve documentation formatting (#7408)
### Description
This PR fixes several issues detected by markdownlint-cli2 
<!-- - Describe your changes. -->

### Motivation and Context
Better documentation.
<!-- - Why is this change required? What problem does it solve? -->
<!-- - If it fixes an open issue, please link to the issue here. -->

---------

Signed-off-by: Yuanyuan Chen <cyyever@outlook.com>
2025-10-17 20:42:08 -07:00
Yuanyuan Chen a69e5a227c Fix white space (#7344)
### Description
<!-- - Describe your changes. -->
Format and remove white space in the docs by markdownlint-cli2. The aim
is enable the tool in CI.
### Motivation and Context
Better docs
<!-- - Why is this change required? What problem does it solve? -->
<!-- - If it fixes an open issue, please link to the issue here. -->

Signed-off-by: Yuanyuan Chen <cyyever@outlook.com>
2025-10-01 08:46:21 -07:00
Emmanuel Ferdman a57b1528c7 Update Jupyter notebook examples (#6729)
### Description
Small PR - Commit c1bd5cca13 moved the
notebook examples. This PR adjusts sources to changes.

Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
2025-02-24 20:09:00 +00:00
kolasaniv1996 8f436ecbaa Fix Pad operator example in Python API docs (correct attribute usage) (#6702)
### Description
This PR corrects the `Pad` operator example in the Python API
documentation. The original code incorrectly treated `value` as an input
tensor and used an invalid `pads` data type. The updated example sets
`value` as a float attribute, uses `INT64` for `pads`, and includes
OPSET 11 compatibility.

### Motivation and Context
The incorrect example could lead users to create invalid ONNX models.
This fix ensures the documentation reflects proper usage of the `Pad`
operator and ONNX standards, improving the developer experience.

Signed-off-by: vivek kolasani kolasaniv1996@gmail.com
Signed-off-by: EC2 Default User <ec2-user@ip-172-31-73-195.ec2.internal>
Co-authored-by: EC2 Default User <ec2-user@ip-172-31-73-195.ec2.internal>
2025-02-14 23:01:07 +00:00
G. Ramalingam 6de4d5be64 Add documentation for inliner (#5712)
Add documentation for inliner

---------

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>
2023-10-31 15:12:09 +00:00
Justin Chu 468f1fb500 Publish md files under docs/ to the documentation site (#5312)
### Motivation and Context


[main/docs](https://github.com/onnx/onnx/tree/main/docs?rgh-link-date=2023-04-15T15%3A01%3A38Z)
has a lot of good information about onnx. It would be nice if we can
publish them all to the documentation site for better discoverability
and readability.

Fixes #5135

### Preview

<img width="1303" alt="image"
src="https://github.com/onnx/onnx/assets/11205048/9dedbd2d-a2d2-49ae-a551-6ba868c736b9">

<img width="1053" alt="image"
src="https://github.com/onnx/onnx/assets/11205048/6c7411d4-e457-44e7-8256-df455087a2cb">


Follow up in separate PRs

- Rewrite the inline links to point to the repository

---------

Signed-off-by: Justin Chu <justinchu@microsoft.com>
2023-06-19 18:51:12 +00:00
trinhgiahuy 3332519b83 Fix typo in Converting Version of an ONNX Model (#5059)
Signed-off-by: trinhgiahuy <65078173+trinhgiahuy@users.noreply.github.com>
2023-03-28 17:50:06 +00:00
Andreas Fehlner ddec8a85eb start: add missing copyright and license information (#5009)
* add missing copyright and license information

Signed-off-by: Andreas Fehlner <fehlner@arcor.de>

* some fixes

Signed-off-by: Andreas Fehlner <fehlner@arcor.de>

* fix unwanted removed pylint: disable

Signed-off-by: Andreas Fehlner <fehlner@arcor.de>

* undo files with pyllint info

Signed-off-by: Andreas Fehlner <fehlner@arcor.de>

* lint

Signed-off-by: Andreas Fehlner <fehlner@arcor.de>

* remove generated files

Signed-off-by: Andreas Fehlner <fehlner@arcor.de>

* remove autogen file

Signed-off-by: Andreas Fehlner <fehlner@arcor.de>

* remove autogen files

Signed-off-by: Andreas Fehlner <fehlner@arcor.de>

* update

Signed-off-by: Andreas Fehlner <fehlner@arcor.de>

* TestCoverage

Signed-off-by: Andreas Fehlner <fehlner@arcor.de>

* fix

Signed-off-by: Andreas Fehlner <fehlner@arcor.de>

* Resolve Merge conflict by removing TypeAnnotations

Signed-off-by: Andreas Fehlner <fehlner@arcor.de>

---------

Signed-off-by: Andreas Fehlner <fehlner@arcor.de>
Co-authored-by: G. Ramalingam <grama@microsoft.com>
2023-03-21 22:28:47 +00:00
G. Ramalingam fe76da41b1 Add method to type-check a function (#4912)
* Expose function type checker

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>

* Expose inference-check for function

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>

* Add test case

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>

* Move from checker to inference

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>

* Add attribute test

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>

* One more test

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>

* fix import

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>

* Unused parameters

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>

* Formatting changes

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>

* Formatting changes

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>

* Vector reserve and unused parameters

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>

* Add documentation

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>

* Address PR feedback

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>

* Omit unused imports

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>

---------

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>
2023-02-28 21:02:18 +00:00
Nat Kershaw (MSFT) 5a294c41ce Rename onnx_docs_folder to operator in docs (#4623)
* Update ONNX docs with better URLs

Signed-off-by: Nat Kershaw <nakersha@microsoft.com>

* Try to fix lint error

Signed-off-by: Nat Kershaw <nakersha@microsoft.com>

Signed-off-by: Nat Kershaw <nakersha@microsoft.com>
2022-10-26 12:29:35 -07:00
Xavier Dupré 73c4d7c97e Add a link to the HTML documentation from the main page (#4594)
* Create pages2.yml

Signed-off-by: xadupre <xadupre@microsoft.com>

* reference documentation from the main page

Signed-off-by: xadupre <xadupre@microsoft.com>

* remove file

Signed-off-by: xadupre <xadupre@microsoft.com>

Signed-off-by: xadupre <xadupre@microsoft.com>
2022-10-17 07:53:27 +00:00
Chun-Wei Chen 136a2c0e07 Format Python code in documents with black (#4530)
* format PythonAPIOverview.md

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* black other docs

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
2022-10-04 14:51:35 +00:00
Chun-Wei Chen 46b9627555 Fix several issues regarding recent mapping update (#4551)
* add missing case for Squence.MAP

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* remove warning and improve printable_graph

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* fix lint and mypy

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* _NP_TYPE_TO_TENSOR_TYPE and mention available in ONNX 1.13

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* add test to prevent throwing deprecation in new functions

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* add bfloat test  for tensor_dtype_to_field

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* add more tests for bfloat16

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
2022-09-30 11:54:30 -07:00
Chun-Wei Chen de2459972d Improve mapping and add more tests for make_tensor (#4270)
* Improve mapping and add more tests for make_tensor

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* fix mypy typecheck failures

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* fix issues

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* first fix by reviews

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* use double quotes instead of single one

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* fix mypy typecheck

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* move to function from mapping to helper

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* remove duplicate import

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* fix flake8

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* fix getattr error due to np.bool

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* use helper instead of mapping in all places

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* update test coverage

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* fix typecheck

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* update test coverage

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* update operators.md

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* fix warnings

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* introduce get_attr_from_sequence_elem_type and optional

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* remove wrong import

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* use namedtuple for better readability

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* fix warnings and conflicts

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* import KeysView from typing instead of collections

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* fix mypy failures

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* isort and black

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* add docs

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* use dobule quote and f-string

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* remove space

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* dtype instead of type

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* more dtype

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* fix isort and remove tensor_dtype_to_storage_numpy_type

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* remove get_attr_from_sequence_elem_type and optional

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* fix mypy

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* move section in PythonAPI

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* fix lint

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* fix lint part 2

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* cover call examples in PythonAPI

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
2022-09-27 21:22:07 -07:00
Howard f4dea9e68b Change the wrong words of second layer **input** (#4044)
Signed-off-by: DESKTOP-6DC8K0E\User <How-Wang>

Co-authored-by: Chun-Wei Chen <jacky82226@gmail.com>
2022-03-10 00:12:13 +00:00
Xingyu Xie 10da6f2e91 Fix the bug of shape in docs (#3927)
* fix the bug of shape

Signed-off-by: namasikanam <namasikanam@gmail.com>

* fix the bug of shape

Signed-off-by: namasikanam <namasikanam@gmail.com>

Co-authored-by: Ashwini Khade <askhade@microsoft.com>
2022-01-11 14:21:19 +08:00
Chun-Wei Chen 96516aecd4 Migration to using main branch (#3925)
* add warning announce

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* Rename to main branch globally

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
2022-01-08 21:04:49 -08:00
Joaquin Anton 94fb492590 Add compose utils (#3820)
* Add onnx.compose.merge

Signed-off-by: Joaquin Anton <janton@nvidia.com>

* Add model check

Signed-off-by: Joaquin Anton <janton@nvidia.com>

* Add add_prefix and expand_out_dim

Signed-off-by: Joaquin Anton <janton@nvidia.com>

* Test negative indices for expand_out_dim

Signed-off-by: Joaquin Anton <janton@nvidia.com>

* Add missing type check

Signed-off-by: Joaquin Anton <janton@nvidia.com>

* Improve error reporting

Signed-off-by: Joaquin Anton <janton@nvidia.com>

* Remove unused variables

Signed-off-by: Joaquin Anton <janton@nvidia.com>

* Add merge_models

Signed-off-by: Joaquin Anton <janton@nvidia.com>

* style fix

Signed-off-by: Joaquin Anton <janton@nvidia.com>

* style fixes

Signed-off-by: Joaquin Anton <janton@nvidia.com>

* Remove unused import

Signed-off-by: Joaquin Anton <janton@nvidia.com>

* Address code review comments

Signed-off-by: Joaquin Anton <janton@nvidia.com>

* Fix import

Signed-off-by: Joaquin Anton <janton@nvidia.com>

* Fix LGTM issues

Signed-off-by: Joaquin Anton <janton@nvidia.com>

* Add Python API usage, address code review issues, improve testing

Signed-off-by: Joaquin Anton <janton@nvidia.com>

* Fix flake8 issues

Signed-off-by: Joaquin Anton <janton@nvidia.com>

* add_prefix to rename local function. Drop unused initializers when merging graphs/models

Signed-off-by: Joaquin Anton <janton@nvidia.com>

* Drop unnecessary value_info entries when merging models

Signed-off-by: Joaquin Anton <janton@nvidia.com>
2021-12-07 08:27:52 -08:00
Yongxin Wang 5515769e19 Fix dead link for Syntax.md (#3605)
Fix dead link for Syntax.md

Signed-off-by: Yongxin Wang <wangyongxinsi1013@sogou-inc.com>
2021-08-04 16:34:38 +00:00
G. Ramalingam 6c77a41121 Parser py (#3540)
* Export parser methods to python

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>

* Undo irrelevant format changes

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>

* Address CI failures

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>

* Address PR feedback

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>

* Fix CI error

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>

* Address flake8 formatting

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>

* Add documentation

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>

* Fix parser error due to merge

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>

* Address lgtm-bot warning

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>

* Address lgtm-bot complaint

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>

* lgtm-bot warning

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>

* Address typecheck error

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>
2021-07-02 16:28:19 +00:00
Gary Miguel 1cacda1fa5 Python API Overview: minor improvements for clarity (#3446)
Also use repo-relative links so that they'll work as expected locally or
in a branch.

Signed-off-by: Gary Miguel <garymiguel@microsoft.com>
2021-04-30 16:18:05 +00:00
Anna 522b000546 Modify existing function in external data helper (#3280)
* Modify existing function and add a new function to convert raw data as external data to allow converting attributes and saving the model

Signed-off-by: Anna Jung (VMware) <antheaj@vmware.com>

* Modify existing save model api to optionally convert and save as external data

Signed-off-by: Anna Jung (VMware) <antheaj@vmware.com>

* Add a fix for a few nits in the comment

Signed-off-by: Anna Jung (VMware) <antheaj@vmware.com>

Co-authored-by: Ashwini Khade <askhade@microsoft.com>
2021-03-24 13:02:31 -07:00
daquexian 03e6c8f2ad remove optimizer related codes (#3288)
Signed-off-by: daquexian <daquexian566@gmail.com>

Co-authored-by: Ke Zhang <linkerzhang@yeah.net>
Co-authored-by: Ashwini Khade <askhade@microsoft.com>
2021-03-15 15:01:14 -07:00
Sheng Zha bd2ff65b77 [LICENSE] update license to Apache License v2.0 (#3159)
* [LICENSE] update license to Apache License v2.0

Signed-off-by: Sheng Zha <zhasheng@amazon.com>

* fix flake8

Signed-off-by: Sheng Zha <zhasheng@amazon.com>

* update auto generated docs

Signed-off-by: Sheng Zha <zhasheng@amazon.com>

* update cmake and bat

Signed-off-by: Sheng Zha <zhasheng@amazon.com>

* Update file to trigger DCO check

Signed-off-by: Prasanth Pulavarthi <prasanth.pulavarthi@microsoft.com>
2021-01-07 14:16:14 -08:00
王振华 (Zhenhua WANG) 191d2dd838 util: function to extract part of an ONNX model (#2994)
* util: function to extract part of an ONNX model

Sometimes, people would like to _extract_ part of an
model for development, validation or other purposes.

With `onnx.util.extract`, this is doable by specifying
the input and output tensor names of the subgraph.

Signed-off-by: Zhenhua Wang <zhenhuaw@nvidia.com>

* Address review comments #1

* Re-style function of Extractor
* Reject empty input/output names
* Misc change for readibility
* Type annotation

Signed-off-by: Zhenhua Wang <zhenhuaw@nvidia.com>
2020-10-12 09:54:25 -07:00
Chun-Wei Chen cd9d5c8b85 add infer_shapes_path (#3012)
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
2020-10-10 11:23:27 -07:00
Chun-Wei Chen 09a4e65bb0 Catch >2GB models in checker (#2744)
* Try to enable full_check

* revert meaningless modification

This reverts commit fdaa6a91eae123f68141370aafa13841551b0295, reversing
changes made to 40d56bd08714534edca3dae674d82aba1a7356de.

Debug for all_types

Revert "Debug for all_types"

This reverts commit 3aa921a9ea7d82080265d1d95b7ec6cf3cdfa343.

restore onnx

This reverts commit fdaa6a91eae123f68141370aafa13841551b0295, reversing
changes made to 40d56bd08714534edca3dae674d82aba1a7356de.

Debug for all_types

Revert "Debug for all_types"

This reverts commit 3aa921a9ea7d82080265d1d95b7ec6cf3cdfa343.

Revert "restore onnx"

This reverts commit aadc4da654960c8248b502dd71a592d95eafd6db.

restore onnx due to gitignore them unintentionally

This reverts commit fdaa6a91eae123f68141370aafa13841551b0295, reversing
changes made to 40d56bd08714534edca3dae674d82aba1a7356de.

Debug for all_types

Revert "Debug for all_types"

This reverts commit 3aa921a9ea7d82080265d1d95b7ec6cf3cdfa343.

restore onnx

This reverts commit fdaa6a91eae123f68141370aafa13841551b0295, reversing
changes made to 40d56bd08714534edca3dae674d82aba1a7356de.

Debug for all_types

Revert "Debug for all_types"

This reverts commit 3aa921a9ea7d82080265d1d95b7ec6cf3cdfa343.

Revert "restore onnx"

This reverts commit aadc4da654960c8248b502dd71a592d95eafd6db.

* Accumulate error msgs for checker

* Accumulate error messages and trigger runtime error while checking type consistency.

Print type consistency

add nextline between various error msgs

add nextline

* Change external tensors into default after loading; Add filepath field;
pass to checker with filepath

* Decouple the check of inference error to another PR

* Revert the commit of introducing model_path in model proto

* Add warning for large models which is > 2GB

* Improve catching 2GB

* Use (str, Warning) to prevent (unicode) error

* Force to use string

* Use expcetion instead of warning for catching large models

* add comments for load external data

* test check 2gb

* Change to ValueError from RuntimeError for 2GB models

* Refactor external data test and use iteration to avoid memory exceed

* Create ExternalData.md

* Add usage for using external data

* load and checker for external data in PythonAPI

* Add a link to ExternalData.md in IR.md

Co-authored-by: Vinitra Swamy <vinitras@gmail.com>
Co-authored-by: G. Ramalingam <grama@microsoft.com>
2020-06-12 13:05:23 -07:00
AlexMuresan 477a9b8771 Edited PythonAPIOverview.md (#2491)
* Edited PythonAPIOverview.md

The example given in the "Creating an ONNX Model Using Helper
Functions" example.

* Edited PythonAPIOverview.md

The example given in the "Creating an ONNX Model Using Helper
Functions" example was not working as expected.

Running the given code would throw a ValidationError() regarding
the node specification (i.e.: "Context: Bad node spec").

This change uses the current node specification, solving the issue.
2019-12-12 12:21:19 -08:00
Bowen Bao 599f3da985 Add helper function update_inputs_outputs_dims to tools (#2148)
* Add a helper function update_inputs_outputs_dims to tools

* fix link to doc

* newline at the end

* add test for tools

* doc props

* nit

* ci tests

* ci tests 2

* accept shapes by dictionary inputs and add more error handling

* Update onnx/tools/update_model_dims.py

nit: rephrasing

Co-Authored-By: Wei-Sheng Chin <wschin@outlook.com>

* remove debug line

* fix type annotation

* fix annotation

* fix annotation

* fix annotation

* fix flake8
2019-09-13 15:20:29 -07:00
LeicongLi 5952b7f52a python api example typo fix (#2155) 2019-07-17 15:44:13 -07:00
Plinio Silveira 4b51596acb Update docs to reference optimizer.get_available_passes() (#1262)
* Update docs to reference optimizer.get_available_passes()

* typo

* Switch order of optimer methods to be in a more logical order
2018-08-09 09:32:36 -04:00
Akshay Chalana 13ee739b3d Opset Version Converter (#1148)
* Initial version converter skeleton

* Adapter interface, more complete conversion procedure

* More fleshed out procedure for version conversion

* Added map of nodes to schemas

* Registration Mechanism complete; adapter_lookup mostly there

* Initial adapter_lookup finished

* Added opset_version handler to ir_pb_converter

* Debugging version converter and abstraction

Summary: Basic debugging, finished initial C++ implementation of
version_converter

Test Plan: Will write tests once python interface is finished

Reviewers: lufang, smessmer

Subscribers:

Tasks:

Tags:

* Fixed IR to hold a list of opset_version

* Debugging, fixes to ir

* Only compilation error: use of unique_ptr copy constructor;

* Initial version converter skeleton

* More fleshed out procedure for version conversion

* Registration Mechanism complete; adapter_lookup mostly there

* Debugging version converter and abstraction

Summary: Basic debugging, finished initial C++ implementation of
version_converter

Test Plan: Will write tests once python interface is finished

Reviewers: lufang

Subscribers:

Tasks:

Tags:

* Fixed IR to hold a list of opset_version

* Debugging, fixes to ir

* Only compilation error: use of unique_ptr copy constructor;

* Fixed map

* Fixed map

* Reverting map to be multi-layered

* Reverting map to be multi-layered

* Fixed all compilation errors in version_converter

* Fixed all compilation errors in version_converter

* Compiling successfully

* Compiling successfully

* Version Converter Python Interface - Not Yet Functional

* Resolved Python adapter compilation issue

* More cpp2py_export changes for version_converter, as well as tests

* More cpp2py_export changes for version_converter, as well as tests

* Finished initial version_converter tests

* Finished initial version_converter tests

* Added asserts to tests and overall documentation

* Refactored ConvertVersion to take OperatorSetIdProto instead of OpSetID

* Refactored ConvertVersion to take OperatorSetIdProto instead of OpSetID

* Fixed version_converter_test to catch exceptions

* Refactored VersionConverter into BaseConverter

* Refactored VersionConverter into BaseConverter

* Fixed optimize_onnx iPython test to include domain

* Fixed optimize_onnx iPython test to include domain

* Fixed uncertainty bugs in converter; not sure how to fix lack of generated object file

* Switched sscanf to atoi

* Use int64_t

* More int conversions

* More conversions to int64_t

* uint64_t

* Added Version Converter to PythonAPIOverview

* Python annotations

* Changed indices to unsigned int instead of uint64_t; may introduce problems with size

* Added version_converter stub

* Lint Fixes for Travis Build

* Adapt now takes a node

* Addressed first round of code review except intermediate refactoring

* i hate ints

* Better constructor?

* Due to char*, use strcmp instead of ==

* Lots of refactoring to address Junjies comments

* IntraDomainConverter refactor

* Fixed version_converter stub

* Fixed version_converter stub

* Confusion about unique pointers and maps of const and undefined classes

* Documentation?

* Current version of our const bug

* Random changes

* Back to explicit constructor

* Fixes to Sebastian's comments

* Finished addressing Sebastian's recommendations'

* Fixed build problem with const references

* Addressing Lu comments on this branch

* Fixed version_converter initialization

* int64_t error in OpSetID constructor

* Another int64_t issue in incrementVersion

* Removed direct calls to barf

* Adjust Python docs, atoi to stoi

* fromString instead of string constructor

* No need for int64_t&

* Removed ONNX_NAMESPACE references

* No need for _visit_all_nodes_recursive

* Made test_backwards_incompatible actually backwards incompatible

* Fixed documentation for version_converter.py

* End of namespace comments

* Removed DEBUG flag from DefaultVersionConverter

* More code review fixes

* Move semantics

* Addressed Lu code review, started on NoPreviousVersionAdapter

* Need to check on adapters

* checking on adapters

* Fixed Adapter Interface and Cos Tests

* Addressed Sebastian's Comments

* Added comments to address Lu concerns

* Renamed opset_versions getter

* Removed all remaining ONNX_NAMESPACE references; not sure about strcmps

* Removed str_cmp

* Initial changes per Lu suggestions; still finishing automated NoPreviousVersionAdapter detection

* Getting new search from adapters

* Getting up from adapters

* Debug statements

* Added condition to verify defined op_name

* Removed tags

* Changed reference semantics per Sebastian suggestions

* No Previous Version rename

* Finished addressing Lu comments
2018-07-26 18:00:16 -07:00
Plinio Silveira 17818ea03a Fix line number for list of optimizations (#1201) 2018-07-16 13:31:42 -07:00
Lu Fang 5dd68e634b Add a util function: polish_model (#1000) 2018-05-22 08:21:51 +08:00
Dmytro Dzhulgakov 985af3f5a0 Update PythonAPIOverview.md (#738) 2018-04-09 20:05:51 -07:00
Lu Fang be546e257c Improve optimizer's API and docs (#713)
* Improve optimizer API to accept ModelProto directly

* Update the docs

* only accept model proto

* Address comments

* Fix linter

* Fix the comments
2018-04-06 13:45:50 -07:00
Lu Fang c61506f9f4 Fix the shape inference python API (#716)
* Fix the shape inference python API

* Lint the code
2018-04-05 22:17:31 -07:00
anderspapitto fcb4ae329f docs rewording: Important Python Functions -> Python API Overview (#721) 2018-04-05 12:40:08 -07:00