Skip to content

Commit

Permalink
fix test_export_constraints_error_not_in_range (pytorch#137500)
Browse files Browse the repository at this point in the history
Test Plan: fixed

Differential Revision: D64052011

Pull Request resolved: pytorch#137500
Approved by: https://github.com/tugsbayasgalan
  • Loading branch information
avikchaudhuri authored and pytorchmergebot committed Oct 9, 2024
1 parent abb00ef commit a02093e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test/export/test_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,14 @@ def forward(self, x):

inp = torch.zeros([3])
dim_x = torch.export.Dim("dim_x", min=6)
with self.assertRaisesRegex(torch._dynamo.exc.UserError, "not in range"):
torch.export.export(

if is_non_strict_test(self._testMethodName):
error_type = torch.fx.experimental.symbolic_shapes.ConstraintViolationError
else:
error_type = torch._dynamo.exc.UserError

with self.assertRaisesRegex(error_type, "not in range"):
export(
InvalidInputConflictWithInputConstraints(),
(inp,),
dynamic_shapes={"x": {0: dim_x}},
Expand Down

0 comments on commit a02093e

Please sign in to comment.