Skip to content

Commit c8566a0

Browse files
angelayipytorchmergebot
authored andcommitted
[export] Use patching in test (pytorch#155132)
Fixes #ISSUE_NUMBER Pull Request resolved: pytorch#155132 Approved by: https://github.com/pianpwk
1 parent 65a5eb8 commit c8566a0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/export/test_export.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12916,6 +12916,7 @@ def forward(self, x, y):
1291612916
@testing.expectedFailureCppSerDes # TODO: When we deserialize we somehow hardcode sympy.lower to 2
1291712917
@testing.expectedFailureSerDerNonStrict
1291812918
@testing.expectedFailureSerDer
12919+
@torch.fx.experimental._config.patch(backed_size_oblivious=True)
1291912920
def test_baddbmm(self):
1292012921
class M(torch.nn.Module):
1292112922
def __init__(self):
@@ -12934,7 +12935,6 @@ def forward(self, x):
1293412935
x2 = torch.randn(64, 1, 64, dtype=torch.float16)
1293512936
m = M()
1293612937

12937-
torch.fx.experimental._config.backed_size_oblivious = True
1293812938
ep = export(m, (x2,), dynamic_shapes=({1: Dim("batch")},))
1293912939

1294012940
self.assertTrue(torch.allclose(m(x2), ep.module()(x2)))
@@ -13400,6 +13400,7 @@ def forward(self, x):
1340013400
self.assertTrue(torch.allclose(comp_mod(inp1), mod(inp1)))
1340113401
self.assertTrue(torch.allclose(comp_mod(inp2), mod(inp2)))
1340213402

13403+
@torch.fx.experimental._config.patch(backed_size_oblivious=True)
1340313404
def test_repeat_interleave(self):
1340413405
class M(torch.nn.Module):
1340513406
def forward(self, values, batch_sizes):
@@ -13411,7 +13412,6 @@ def forward(self, values, batch_sizes):
1341113412
)
1341213413

1341313414
inp = (torch.randint(0, 10, (1, 3)), torch.randint(0, 10, (1,)))
13414-
torch.fx.experimental._config.backed_size_oblivious = True
1341513415
ep = torch.export.export(
1341613416
M(), inp, dynamic_shapes=({0: Dim("dim")}, {0: Dim("dim")})
1341713417
)

0 commit comments

Comments
 (0)