未验证 提交 daaab3ad 编写于 作者: A Alexander Alekhin 提交者: GitHub

Merge pull request #968 from rogday:revert_renaming

Add output registration test
......@@ -1650,3 +1650,19 @@ models_files = os.path.join("models", name + ".onnx")
onnx.save(model, models_files)
########################## const / x ##########################
class OutputRegistration(nn.Module):
def __init__(self):
super(OutputRegistration, self).__init__()
self.c = torch.randn(2, 2)
def forward(self, a, b):
return (a + b) + self.c
a = Variable(torch.randn(2, 2))
b = Variable(torch.randn(2, 2))
model = OutputRegistration()
save_data_and_model_multy_inputs('output_registration', model, a, b)
model = onnx.load('models/output_registration.onnx')
model.graph.node[0].name = model.graph.output[0].name
onnx.save(model, 'models/output_registration.onnx')
\ No newline at end of file
pytorch1.9:

0
124"Add
?3
Constant_1"Constant*$
value*J˿D>A?m(>

2
34Add_2"Addtorch-jit-exportZ
0


Z
1


b
4


B
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册