8000 export test case · pytorch/pytorch@84ec050 · GitHub
[go: up one dir, main page]

Skip to content

Commit 84ec050

Browse files
committed
export test case
1 parent 54a4d7d commit 84ec050

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/export/test_export.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -2635,14 +2635,16 @@ def __init__(self):
26352635
self.register_buffer("buf", torch.zeros(10))
26362636
def forward(self, x, y):
26372637
self.buf[0 : x.shape[0]] = x
2638-
return x + 2, y[:, ::2]
2638+
return x + 2, y[:, ::1]
26392639

26402640
inps = (torch.randn(10), torch.randn(32, 36))
26412641
dynamic_shapes = {
26422642
"x": {0: Dim("dx", min=1, max=10)},
26432643
"y": {0: Dim("dy0"), 1: Dim("dy1")}
26442644
}
2645-
ep = export(Foo(), inps, dynamic_shapes=dynamic_shapes, strict=False)
2645+
ep = export(Foo(), inps, dynamic_shapes=dynamic_shapes)
2646+
ep.module()(torch.randn(9), torch.randn(4, 4))
2647+
ep.module()(torch.randn(1), torch.randn(1, 1))
26462648

26472649
def test_duplicate_modules_with_non_persistent_buffers(self):
26482650
class FooWithBuf(torch.nn.Module):

0 commit comments

Comments
 (0)
0