Skip to content

Commit daaab3a

Browse files
authored
Merge pull request #968 from rogday:revert_renaming
Add output registration test
2 parents ebd991b + 703e2f5 commit daaab3a

5 files changed

+38
-0
lines changed
Binary file not shown.
Binary file not shown.
Binary file not shown.

testdata/dnn/onnx/generate_onnx_models.py

+16
Original file line numberDiff line numberDiff line change
@@ -1650,3 +1650,19 @@ def forward(self, x):
16501650
onnx.save(model, models_files)
16511651

16521652
########################## const / x ##########################
1653+
1654+
class OutputRegistration(nn.Module):
1655+
def __init__(self):
1656+
super(OutputRegistration, self).__init__()
1657+
self.c = torch.randn(2, 2)
1658+
1659+
def forward(self, a, b):
1660+
return (a + b) + self.c
1661+
1662+
a = Variable(torch.randn(2, 2))
1663+
b = Variable(torch.randn(2, 2))
1664+
model = OutputRegistration()
1665+
save_data_and_model_multy_inputs('output_registration', model, a, b)
1666+
model = onnx.load('models/output_registration.onnx')
1667+
model.graph.node[0].name = model.graph.output[0].name
1668+
onnx.save(model, 'models/output_registration.onnx')
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
pytorch1.9:�
2+

3+
0
4+
124"Add
5+
?3
6+
Constant_1"Constant*$
7+
value*J��˿�D�>��A?m(�>�
8+

9+
2
10+
34Add_2"Addtorch-jit-exportZ
11+
0
12+

13+

14+
Z
15+
1
16+

17+

18+
b
19+
4
20+

21+

22+
B

0 commit comments

Comments
 (0)