Skip to content

Commit

Permalink
for issue 3849 to confirm that type check is performed during checker… (
Browse files Browse the repository at this point in the history
onnx#3902)

* Fix typos (onnx#3894)

Signed-off-by: Lewis Tunstall <[email protected]>
Signed-off-by: Liqun Fu <[email protected]>

* Honor existing dim_param in shape inference (onnx#3896)

* Honor existing dim_param

Before this change, existing dim_param was overwritten by generated
symbols like `unk__`. `NonZero` is used to test the behavior.

Signed-off-by: Shinichiro Hamaji <[email protected]>

* Fix test expectation of symbolic_shape_test.py

Signed-off-by: Shinichiro Hamaji <[email protected]>

* Keep the original check as suggested in review

Signed-off-by: Shinichiro Hamaji <[email protected]>

* Simplify the logic of mergeShapesAndTypes

Signed-off-by: Shinichiro Hamaji <[email protected]>

Co-authored-by: Ashwini Khade <[email protected]>
Signed-off-by: Liqun Fu <[email protected]>

* for issue 3849 to confirm that type check is performed during checker.check_model call

Signed-off-by: Liqun Fu <[email protected]>

* fix path to InferenceError

Signed-off-by: Liqun Fu <[email protected]>

* replace whitelist by safelist (onnx#3900)

Signed-off-by: Alexandre Eichenberger <[email protected]>
Signed-off-by: Liqun Fu <[email protected]>

* add checker test case for input type mismatch conflict

Signed-off-by: Liqun Fu <[email protected]>

* remove old numpy in ipynb (onnx#3916)

Signed-off-by: Chun-Wei Chen <[email protected]>
Signed-off-by: Liqun Fu <[email protected]>

* Shapeinf for functions (onnx#3722)

* add shape inference for model local functions

Signed-off-by: Ashwini Khade <[email protected]>

* Plus tests and more changes

Signed-off-by: Ashwini Khade <[email protected]>

* fix typo

Signed-off-by: Ashwini Khade <[email protected]>

* Plus updates

Signed-off-by: Ashwini Khade <[email protected]>

* Plus updates per review

Signed-off-by: Ashwini Khade <[email protected]>

* plus updates

Signed-off-by: Ashwini Khade <[email protected]>
Signed-off-by: Liqun Fu <[email protected]>

* Fix old ConvTranspose shape inference and softmax upgrader (onnx#3893)

* Fixed ConvTranspose-1 shape inference

Brings change from onnx#3188 (for ConvTranspose-11) into old shape inference
Signed-off-by: Matteo Salvarezza <[email protected]>

* Fix softmax adapter

Signed-off-by: Matteo Salvarezza <[email protected]>

Co-authored-by: G. Ramalingam <[email protected]>
Signed-off-by: Liqun Fu <[email protected]>

* Fix Linux i686 Release CI failure due to the latest NumPy (onnx#3918)

* 3.8 and 3.9 use numpy 1.21.5

Signed-off-by: Chun-Wei Chen <[email protected]>

* 1.21.4

Signed-off-by: Chun-Wei Chen <[email protected]>

* 6be8011a073feeca08d256ac64335a19fc8eee4c6312668b6781ace71db0de20

Signed-off-by: Chun-Wei Chen <[email protected]>

* 2021-12-19-a4d7f5a

Signed-off-by: Chun-Wei Chen <[email protected]>

* 1.21.5

Signed-off-by: Chun-Wei Chen <[email protected]>

* 1.16.6

Signed-off-by: Chun-Wei Chen <[email protected]>

* 1.16.6

Signed-off-by: Chun-Wei Chen <[email protected]>

* do not check generated

Signed-off-by: Chun-Wei Chen <[email protected]>

* remove unrelated numpy

Signed-off-by: Chun-Wei Chen <[email protected]>

* if

Signed-off-by: Chun-Wei Chen <[email protected]>

* remove generation

Signed-off-by: Chun-Wei Chen <[email protected]>

* name

Signed-off-by: Chun-Wei Chen <[email protected]>

* add back

Signed-off-by: Chun-Wei Chen <[email protected]>

* for testing

Signed-off-by: Chun-Wei Chen <[email protected]>

* no 1.16.6

Signed-off-by: Chun-Wei Chen <[email protected]>
Signed-off-by: Liqun Fu <[email protected]>

* Remind release manager to remove old onnx-weekly packages after release (onnx#3923)

* remind release manager to remove old onnx-weekly packages

Signed-off-by: Chun-Wei Chen <[email protected]>

* add steps

Signed-off-by: Chun-Wei Chen <[email protected]>
Signed-off-by: Liqun Fu <[email protected]>

* Simplify function definition of context-dependent functions (onnx#3882)

* Simplify function definition of context-dependent functions

Signed-off-by: Ganesan Ramalingam <[email protected]>

* Add missing parenthesis

Signed-off-by: Ganesan Ramalingam <[email protected]>

* Fix errors in function defs

Signed-off-by: Ganesan Ramalingam <[email protected]>

* Eliminate unused variable

Signed-off-by: Ganesan Ramalingam <[email protected]>

* Add int64 type specifier to literal

Signed-off-by: Ganesan Ramalingam <[email protected]>

Co-authored-by: Ashwini Khade <[email protected]>
Signed-off-by: Liqun Fu <[email protected]>

* Migration to using main branch (onnx#3925)

* add warning announce

Signed-off-by: Chun-Wei Chen <[email protected]>

* Rename to main branch globally

Signed-off-by: Chun-Wei Chen <[email protected]>
Signed-off-by: Liqun Fu <[email protected]>

* Fix the bug of shape in docs (onnx#3927)

* fix the bug of shape

Signed-off-by: namasikanam <[email protected]>

* fix the bug of shape

Signed-off-by: namasikanam <[email protected]>

Co-authored-by: Ashwini Khade <[email protected]>
Signed-off-by: Liqun Fu <[email protected]>

* Append dim even both dim value and param are not set (onnx#3828)

* Append dim even both dim value and param are not set

Signed-off-by: Joe <[email protected]>

* Copy dim

Signed-off-by: Joe <[email protected]>

* Revert "Copy dim"

This reverts commit 6623505.

Signed-off-by: Joe <[email protected]>

* Simplify code

Signed-off-by: Joe <[email protected]>

Co-authored-by: Ashwini Khade <[email protected]>
Signed-off-by: Liqun Fu <[email protected]>

* bump to 10.15 in azp (onnx#3941)

Signed-off-by: Chun-Wei Chen <[email protected]>
Signed-off-by: Liqun Fu <[email protected]>

* Add explanation to run gtest (onnx#3933)

Signed-off-by: Joe <[email protected]>

Co-authored-by: Ashwini Khade <[email protected]>
Signed-off-by: Liqun Fu <[email protected]>

* Update TreeEnsembleClassifier and TreeEnsembleRegressor to support tensor as attributes (onnx#3897)

* update TreeEnsembleClassifier and TreeEnsembleRegressor

Signed-off-by: xavier dupré <[email protected]>

* change the type of another attribute

Signed-off-by: xavier dupré <[email protected]>

* add missing file

Signed-off-by: xavier dupré <[email protected]>

* update documentation

Signed-off-by: xavier dupré <[email protected]>

* eol

Signed-off-by: xavier dupré <[email protected]>

* add field with _as_tensor

Signed-off-by: xavier dupré <[email protected]>

* fix error messages

Signed-off-by: xavier dupré <[email protected]>

* fix error message

Signed-off-by: xavier dupré <[email protected]>

* fix missing change

Signed-off-by: xavier dupré <[email protected]>

Co-authored-by: xavier dupré <[email protected]>
Co-authored-by: G. Ramalingam <[email protected]>
Signed-off-by: Liqun Fu <[email protected]>

Co-authored-by: lewtun <[email protected]>
Co-authored-by: Shinichiro Hamaji <[email protected]>
Co-authored-by: Ashwini Khade <[email protected]>
Co-authored-by: Alexandre Eichenberger <[email protected]>
Co-authored-by: Chun-Wei Chen <[email protected]>
Co-authored-by: Matteo Salvarezza <[email protected]>
Co-authored-by: G. Ramalingam <[email protected]>
Co-authored-by: Xingyu Xie <[email protected]>
Co-authored-by: Joe <[email protected]>
Co-authored-by: Xavier Dupré <[email protected]>
Co-authored-by: xavier dupré <[email protected]>
  • Loading branch information
12 people authored Jan 19, 2022
1 parent 2e70f67 commit 6d4e458
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions onnx/test/checker_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,46 @@ def test_check_graph(self): # type: () -> None
graph.initializer[0].name = 'X'
checker.check_graph(graph)

def test_check_graph_types(self): # type: () -> None
# This is for https://github.com/onnx/onnx/issues/3849.
# It confirms that type checking is performed
# when checker.check_model is called with full_check=True

node_div = helper.make_node(
"Div", ["X", "Y"], ["Z"], name="test_div")
node_identity = helper.make_node(
"Identity", ["Z"], ["W"], name="test_identity")

graph = helper.make_graph(
[node_div, node_identity],
"test",
[
helper.make_tensor_value_info("X", TensorProto.FLOAT, [1, 2]),
# intentionally use a BOOL type which is not supported by the Div op.
helper.make_tensor_value_info("Y", TensorProto.BOOL, [1, 2])],
[helper.make_tensor_value_info("W", TensorProto.FLOAT, [1, 2])])

model = helper.make_model(graph, producer_name='test')

self.assertRaises(shape_inference.InferenceError, checker.check_model, model, True)

checker.check_graph(graph)

graph = helper.make_graph(
[node_div, node_identity],
"test",
[
helper.make_tensor_value_info("X", TensorProto.FLOAT, [1, 2]),
# intentionally use a Int32 type which is in conflict with Div's other input X.
helper.make_tensor_value_info("Y", TensorProto.INT32, [1, 2])],
[helper.make_tensor_value_info("W", TensorProto.FLOAT, [1, 2])])

model = helper.make_model(graph, producer_name='test')

self.assertRaises(shape_inference.InferenceError, checker.check_model, model, True)

checker.check_graph(graph)

def test_check_graph_empty_initializer_name(self): # type: () -> None
node = helper.make_node(
"Relu", ["X"], ["Y"], name="test")
Expand Down

0 comments on commit 6d4e458

Please sign in to comment.