Skip to content

Commit 7222224

Browse files
committed
Update onnx examples to change /A/Add->Add_1 etc
1 parent ce187cb commit 7222224

File tree

8 files changed

+49
-49
lines changed

8 files changed

+49
-49
lines changed

examples/ONNX/ab.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"format": "ModECI MDF v0.4",
44
"generating_application": "Python modeci-mdf v0.4.7",
55
"graphs": {
6-
"torch_jit": {
6+
"torch-jit-export": {
77
"nodes": {
8-
"/A/Add": {
8+
"Add_1": {
99
"input_ports": {
1010
"input": {
1111
"shape": [
@@ -19,7 +19,7 @@
1919
"B": {
2020
"value": 1.0
2121
},
22-
"/A/Add": {
22+
"Add_1": {
2323
"function": "onnx::Add",
2424
"args": {
2525
"A": "input",
@@ -28,14 +28,14 @@
2828
}
2929
},
3030
"output_ports": {
31-
"_A_Add_output_0": {
32-
"value": "/A/Add"
31+
"onnx_Mul_2": {
32+
"value": "Add_1"
3333
}
3434
}
3535
},
36-
"/B/Mul": {
36+
"Mul_3": {
3737
"input_ports": {
38-
"_A_Add_output_0": {
38+
"onnx_Mul_2": {
3939
"shape": [
4040
2,
4141
3
@@ -47,27 +47,27 @@
4747
"B": {
4848
"value": 5.0
4949
},
50-
"/B/Mul": {
50+
"Mul_3": {
5151
"function": "onnx::Mul",
5252
"args": {
53-
"A": "_A_Add_output_0",
53+
"A": "onnx_Mul_2",
5454
"B": "B"
5555
}
5656
}
5757
},
5858
"output_ports": {
5959
"_4": {
60-
"value": "/B/Mul"
60+
"value": "Mul_3"
6161
}
6262
}
6363
}
6464
},
6565
"edges": {
66-
"/A/Add._A_Add_output_0_/B/Mul._A_Add_output_0": {
67-
"sender": "/A/Add",
68-
"receiver": "/B/Mul",
69-
"sender_port": "_A_Add_output_0",
70-
"receiver_port": "_A_Add_output_0"
66+
"Add_1.onnx_Mul_2_Mul_3.onnx_Mul_2": {
67+
"sender": "Add_1",
68+
"receiver": "Mul_3",
69+
"sender_port": "onnx_Mul_2",
70+
"receiver_port": "onnx_Mul_2"
7171
}
7272
}
7373
}

examples/ONNX/ab.png

15.2 KB
Loading

examples/ONNX/ab.yaml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ ONNX Model:
22
format: ModECI MDF v0.4
33
generating_application: Python modeci-mdf v0.4.7
44
graphs:
5-
torch_jit:
5+
torch-jit-export:
66
nodes:
7-
/A/Add:
7+
Add_1:
88
input_ports:
99
input:
1010
shape:
@@ -14,35 +14,35 @@ ONNX Model:
1414
parameters:
1515
B:
1616
value: 1.0
17-
/A/Add:
17+
Add_1:
1818
function: onnx::Add
1919
args:
2020
A: input
2121
B: B
2222
output_ports:
23-
_A_Add_output_0:
24-
value: /A/Add
25-
/B/Mul:
23+
onnx_Mul_2:
24+
value: Add_1
25+
Mul_3:
2626
input_ports:
27-
_A_Add_output_0:
27+
onnx_Mul_2:
2828
shape:
2929
- 2
3030
- 3
3131
type: float
3232
parameters:
3333
B:
3434
value: 5.0
35-
/B/Mul:
35+
Mul_3:
3636
function: onnx::Mul
3737
args:
38-
A: _A_Add_output_0
38+
A: onnx_Mul_2
3939
B: B
4040
output_ports:
4141
_4:
42-
value: /B/Mul
42+
value: Mul_3
4343
edges:
44-
/A/Add._A_Add_output_0_/B/Mul._A_Add_output_0:
45-
sender: /A/Add
46-
receiver: /B/Mul
47-
sender_port: _A_Add_output_0
48-
receiver_port: _A_Add_output_0
44+
Add_1.onnx_Mul_2_Mul_3.onnx_Mul_2:
45+
sender: Add_1
46+
receiver: Mul_3
47+
sender_port: onnx_Mul_2
48+
receiver_port: onnx_Mul_2

examples/ONNX/abc.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"nodes": {
5858
"Div_5": {
5959
"input_ports": {
60-
"x_11": {
60+
"x.11": {
6161
"shape": [
6262
2,
6363
3
@@ -72,7 +72,7 @@
7272
"Div_5": {
7373
"function": "onnx::Div",
7474
"args": {
75-
"A": "x_11",
75+
"A": "x.11",
7676
"B": "B"
7777
}
7878
}
@@ -118,14 +118,14 @@
118118
}
119119
},
120120
"output_ports": {
121-
"x_3": {
121+
"x.3": {
122122
"value": "Loop_3"
123123
}
124124
}
125125
},
126126
"Mul_8": {
127127
"input_ports": {
128-
"x_3": {
128+
"x.3": {
129129
"shape": [
130130
1
131131
],
@@ -139,7 +139,7 @@
139139
"Mul_8": {
140140
"function": "onnx::Mul",
141141
"args": {
142-
"A": "x_3",
142+
"A": "x.3",
143143
"B": "B"
144144
}
145145
}
@@ -158,11 +158,11 @@
158158
"sender_port": "onnx_Loop_3",
159159
"receiver_port": "onnx_Loop_3"
160160
},
161-
"Loop_3.x_3_Mul_8.x_3": {
161+
"Loop_3.x.3_Mul_8.x.3": {
162162
"sender": "Loop_3",
163163
"receiver": "Mul_8",
164-
"sender_port": "x_3",
165-
"receiver_port": "x_3"
164+
"sender_port": "x.3",
165+
"receiver_port": "x.3"
166166
}
167167
}
168168
}

examples/ONNX/abc.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ ONNX Model:
4141
nodes:
4242
Div_5:
4343
input_ports:
44-
x_11:
44+
x.11:
4545
shape:
4646
- 2
4747
- 3
@@ -52,7 +52,7 @@ ONNX Model:
5252
Div_5:
5353
function: onnx::Div
5454
args:
55-
A: x_11
55+
A: x.11
5656
B: B
5757
output_ports:
5858
x:
@@ -77,11 +77,11 @@ ONNX Model:
7777
cond: cond
7878
v_initial: onnx_Loop_3
7979
output_ports:
80-
x_3:
80+
x.3:
8181
value: Loop_3
8282
Mul_8:
8383
input_ports:
84-
x_3:
84+
x.3:
8585
shape:
8686
- 1
8787
type: float
@@ -91,7 +91,7 @@ ONNX Model:
9191
Mul_8:
9292
function: onnx::Mul
9393
args:
94-
A: x_3
94+
A: x.3
9595
B: B
9696
output_ports:
9797
_13:
@@ -102,8 +102,8 @@ ONNX Model:
102102
receiver: Loop_3
103103
sender_port: onnx_Loop_3
104104
receiver_port: onnx_Loop_3
105-
Loop_3.x_3_Mul_8.x_3:
105+
Loop_3.x.3_Mul_8.x.3:
106106
sender: Loop_3
107107
receiver: Mul_8
108-
sender_port: x_3
109-
receiver_port: x_3
108+
sender_port: x.3
109+
receiver_port: x.3

examples/ONNX/simple_ab.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def main():
100100
for t in test_values:
101101
print("===================\nEvaluating MDF model with input: %s" % t)
102102
eg.evaluate(initializer={"input": t})
103-
print("Output: %s" % eg.enodes["/B/Mul"].evaluable_outputs["_4"].curr_value)
103+
print("Output: %s" % eg.enodes["Mul_3"].evaluable_outputs["_4"].curr_value)
104104

105105

106106
if __name__ == "__main__":

tests/interfaces/onnx/test_importer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def test_ab():
2626
mdf_executable = EvaluableGraph(mdf_model.graphs[0], verbose=False)
2727

2828
mdf_executable.evaluate(initializer={"input": test_input})
29-
mdf_output = mdf_executable.enodes["/B/Mul"].evaluable_outputs["_4"].curr_value
29+
mdf_output = mdf_executable.enodes["Mul_3"].evaluable_outputs["_4"].curr_value
3030

3131
# Get the translated ONNX model
3232
onnx_models = mdf_to_onnx(mdf_model)

tests/test_scheduler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def test_execution_engine_onnx(tmpdir):
6969
eg = modeci_mdf.execution_engine.main(
7070
"examples/ONNX/ab.%s" % mdf_format, array_format=array_format
7171
)
72-
output = eg.enodes["/B/Mul"].evaluable_outputs["_4"].curr_value
72+
output = eg.enodes["Mul_3"].evaluable_outputs["_4"].curr_value
7373
assert np.array_equal(output, np.full((2, 3), 5))
7474

7575

0 commit comments

Comments
 (0)