Skip to content

Commit c2cf721

Browse files
committed
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
2 parents 9c33634 + daaab3a commit c2cf721

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
@@ -1927,3 +1927,19 @@ def forward(self, x):
19271927
onnx.save(model, models_files)
19281928

19291929
########################## const / x ##########################
1930+
1931+
class OutputRegistration(nn.Module):
1932+
def __init__(self):
1933+
super(OutputRegistration, self).__init__()
1934+
self.c = torch.randn(2, 2)
1935+
1936+
def forward(self, a, b):
1937+
return (a + b) + self.c
1938+
1939+
a = Variable(torch.randn(2, 2))
1940+
b = Variable(torch.randn(2, 2))
1941+
model = OutputRegistration()
1942+
save_data_and_model_multy_inputs('output_registration', model, a, b)
1943+
model = onnx.load('models/output_registration.onnx')
1944+
model.graph.node[0].name = model.graph.output[0].name
1945+
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)