Skip to content

Commit

Permalink
Make test run
Browse files Browse the repository at this point in the history
  • Loading branch information
twata committed Jul 14, 2023
1 parent 9900664 commit d8e2ae3
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions tests/pytorch_pfn_extras_tests/onnx_tests/test_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,8 +426,16 @@ def __init__(self):
super(Net, self).__init__()
self.conv = torch.nn.Conv2d(1, 1, 3)

def map_f(self, u):
return u + 1

def forward(self, x):
y = self.conv(x)
return list(ppe.map(lambda u: u + 1, y))[0]
y1 = self.conv(x)
y2 = self.conv(x)
y = [{"u" : y1}, {"u": y2}]
return list(ppe.map(self.map_f, y))[0]

run_model_test(Net(), (torch.rand(1, 1, 112, 112),), rtol=1e-03)
model = Net()
ppe.to(model, device="cpu")

run_model_test(model, (torch.rand(1, 1, 112, 112),), rtol=1e-03)

0 comments on commit d8e2ae3

Please sign in to comment.