Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ONNX] Enable onnx shape inference in export by default #46629

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
a7b08a3
look at graph output for inferred shape as well
BowenBao Oct 21, 2020
8c04ec3
Update RNN conversion wrt shape inference; Add exception handling for…
BowenBao Oct 23, 2020
0fbfcfa
tmp
BowenBao Oct 27, 2020
60c1cef
enable onnx shape inference by default; Update scalar type analysis
BowenBao Oct 28, 2020
580b69b
skip test: should be fixed in another PR
BowenBao Oct 28, 2020
49cd32b
clang-tidy
BowenBao Oct 28, 2020
317a703
update expect files; fix None dim_param case
BowenBao Oct 29, 2020
3ffbe49
add more comments on type promotion
BowenBao Nov 5, 2020
cbc1108
clang
BowenBao Nov 5, 2020
ff895f6
fix loop metadata copy
BowenBao Nov 9, 2020
4e63b34
uncomment code
BowenBao Nov 10, 2020
6402c84
Merge remote-tracking branch 'upstream/master' into onnx_inf_from_output
BowenBao Nov 11, 2020
7832226
skip test
BowenBao Nov 11, 2020
45f27fd
Merge remote-tracking branch 'upstream/master' into onnx_inf_from_output
BowenBao Nov 11, 2020
697ed6e
Merge remote-tracking branch 'upstream/master' into onnx_inf_from_output
BowenBao Nov 11, 2020
60f89ba
Merge remote-tracking branch 'upstream/master' into onnx_inf_from_output
BowenBao Nov 11, 2020
230142a
Merge remote-tracking branch 'upstream/master' into onnx_inf_from_output
BowenBao Nov 11, 2020
5e7b5d1
improve type promotion logic
BowenBao Nov 12, 2020
2920948
Merge remote-tracking branch 'upstream/master' into onnx_inf_from_output
BowenBao Nov 12, 2020
130a6e0
Merge remote-tracking branch 'upstream/master' into onnx_inf_from_output
BowenBao Nov 13, 2020
502c018
Merge remote-tracking branch 'upstream/master' into onnx_inf_from_output
BowenBao Nov 13, 2020
f7eae4c
Merge remote-tracking branch 'upstream/master' into onnx_inf_from_output
BowenBao Nov 13, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/onnx/expect/TestOperators.test_arange_dynamic.expect
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ graph {
elem_type: 1
shape {
dim {
dim_value: 10
dim_param: "13_0"
}
}
}
Expand Down
31 changes: 21 additions & 10 deletions test/onnx/expect/TestOperators.test_bitshift.expect
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,34 @@ graph {
}
node {
input: "4"
input: "10"
input: "11"
output: "5"
name: "Pow_1"
op_type: "Pow"
}
node {
input: "0"
input: "5"
output: "6"
name: "Div_2"
name: "Cast_2"
op_type: "Cast"
attribute {
name: "to"
i: 1
type: INT
}
}
node {
input: "0"
input: "6"
output: "7"
name: "Div_3"
op_type: "Div"
}
node {
input: "1"
input: "11"
output: "9"
name: "BitShift_3"
input: "12"
output: "10"
name: "BitShift_4"
op_type: "BitShift"
attribute {
name: "direction"
Expand All @@ -44,12 +55,12 @@ graph {
name: "torch-jit-export"
initializer {
data_type: 1
name: "10"
name: "11"
raw_data: "\000\000\200?"
}
initializer {
data_type: 2
name: "11"
name: "12"
raw_data: "\002"
}
input {
Expand Down Expand Up @@ -91,7 +102,7 @@ graph {
}
}
output {
name: "6"
name: "7"
type {
tensor_type {
elem_type: 1
Expand All @@ -110,7 +121,7 @@ graph {
}
}
output {
name: "9"
name: "10"
type {
tensor_type {
elem_type: 2
Expand Down
4 changes: 2 additions & 2 deletions test/onnx/expect/TestOperators.test_empty_like.expect
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ graph {
elem_type: 1
shape {
dim {
dim_value: 5
dim_param: "2_0"
}
dim {
dim_value: 8
dim_param: "2_1"
}
}
}
Expand Down
27 changes: 8 additions & 19 deletions test/onnx/expect/TestOperators.test_expand.expect
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ graph {
}
}
node {
input: "11"
input: "10"
output: "3"
name: "ConstantOfShape_1"
op_type: "ConstantOfShape"
Expand Down Expand Up @@ -74,35 +74,24 @@ graph {
}
node {
input: "7"
output: "8"
name: "Cast_6"
op_type: "Cast"
attribute {
name: "to"
i: 9
type: INT
}
}
node {
input: "8"
input: "3"
input: "1"
output: "9"
name: "Where_7"
output: "8"
name: "Where_6"
op_type: "Where"
}
node {
input: "0"
input: "9"
output: "10"
name: "Expand_8"
input: "8"
output: "9"
name: "Expand_7"
op_type: "Expand"
}
name: "torch-jit-export"
initializer {
dims: 1
data_type: 7
name: "11"
name: "10"
raw_data: "\003\000\000\000\000\000\000\000"
}
input {
Expand All @@ -122,7 +111,7 @@ graph {
}
}
output {
name: "10"
name: "9"
type {
tensor_type {
elem_type: 1
Expand Down
4 changes: 2 additions & 2 deletions test/onnx/expect/TestOperators.test_full.expect
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,10 @@ graph {
elem_type: 1
shape {
dim {
dim_value: 3
dim_param: "10_0"
}
dim {
dim_value: 4
dim_param: "10_1"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions test/onnx/expect/TestOperators.test_full_like.expect
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ graph {
elem_type: 1
shape {
dim {
dim_value: 3
dim_param: "2_0"
}
dim {
dim_value: 4
dim_param: "2_1"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions test/onnx/expect/TestOperators.test_ones_like.expect
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ graph {
elem_type: 1
shape {
dim {
dim_value: 6
dim_param: "2_0"
}
dim {
dim_value: 10
dim_param: "2_1"
}
}
}
Expand Down
33 changes: 22 additions & 11 deletions test/onnx/expect/TestOperators.test_remainder.expect
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,41 @@ producer_name: "pytorch"
producer_version: "CURRENT_VERSION"
graph {
node {
input: "0"
input: "1"
output: "2"
name: "Div_0"
op_type: "Div"
name: "Cast_0"
op_type: "Cast"
attribute {
name: "to"
i: 1
type: INT
}
}
node {
input: "0"
input: "2"
output: "3"
name: "Floor_1"
op_type: "Floor"
name: "Div_1"
op_type: "Div"
}
node {
input: "3"
input: "1"
output: "4"
name: "Mul_2"
op_type: "Mul"
name: "Floor_2"
op_type: "Floor"
}
node {
input: "0"
input: "4"
input: "2"
output: "5"
name: "Sub_3"
name: "Mul_3"
op_type: "Mul"
}
node {
input: "0"
input: "5"
output: "6"
name: "Sub_4"
op_type: "Sub"
}
name: "torch-jit-export"
Expand Down Expand Up @@ -69,7 +80,7 @@ graph {
}
}
output {
name: "5"
name: "6"
type {
tensor_type {
elem_type: 1
Expand Down
4 changes: 2 additions & 2 deletions test/onnx/expect/TestOperators.test_topk.expect
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ graph {
elem_type: 1
shape {
dim {
dim_value: 3
dim_param: "4_0"
}
}
}
Expand All @@ -80,7 +80,7 @@ graph {
elem_type: 7
shape {
dim {
dim_value: 3
dim_param: "5_0"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ graph {
elem_type: 1
shape {
dim {
dim_value: 3
dim_param: "4_0"
}
}
}
Expand All @@ -90,7 +90,7 @@ graph {
elem_type: 7
shape {
dim {
dim_value: 3
dim_param: "5_0"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions test/onnx/expect/TestOperators.test_unique.expect
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ graph {
elem_type: 1
shape {
dim {
dim_value: 2
dim_param: "1_0"
}
dim {
dim_value: 3
Expand All @@ -73,7 +73,7 @@ graph {
elem_type: 7
shape {
dim {
dim_value: 2
dim_param: "4_0"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,16 @@ graph {
elem_type: 1
shape {
dim {
dim_value: 1
dim_param: "4_0"
}
dim {
dim_value: 2
dim_param: "4_1"
}
dim {
dim_value: 6
dim_param: "4_2"
}
dim {
dim_value: 8
dim_param: "4_3"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,16 @@ graph {
elem_type: 1
shape {
dim {
dim_value: 1
dim_param: "4_0"
}
dim {
dim_value: 2
dim_param: "4_1"
}
dim {
dim_value: 6
dim_param: "4_2"
}
dim {
dim_value: 8
dim_param: "4_3"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions test/onnx/expect/TestOperators.test_zeros_like.expect
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ graph {
elem_type: 1
shape {
dim {
dim_value: 5
dim_param: "2_0"
}
dim {
dim_value: 8
dim_param: "2_1"
}
}
}
Expand Down