demoncoder-crypto commented on code in PR #17898:
URL: https://github.com/apache/tvm/pull/17898#discussion_r2071554507


##########
tests/python/relax/test_frontend_from_exported_program.py:
##########
@@ -4625,6 +4625,62 @@ def main(
     dynamic_shapes = {"x1": {0: batch}, "x2": {0: batch}}
 
     verify_model(DynamicModel(), example_args, {}, Expected, 
dynamic_shapes=dynamic_shapes)
+    
+def test_dynamic_shape_with_constraints():
+        B = torch.export.Dim("B", min=2, max=10)
+        S = torch.export.Dim("S", min=1)
+        # Use a tuple for args
+        example_args = (torch.randn(3, 4, dtype=torch.float32),)
+        # Dynamic shapes dict maps arg index to shape spec {dim_index: Dim obj}
+        dynamic_shapes = {0: {0: B, 1: S}}
+
+        class SimpleDynamic(torch.nn.Module):
+            def forward(self, x):
+                return torch.relu(x)
+
+        # Explicit export and import

Review Comment:
   I thought it makes it extremely explicit exactly which part of the new 
feature is being tested, the presence and correctness of the constraint 
attributes. This was helpful during development to immediately pinpoint if the 
constraint propagation itself is failing. I forgot to update it after I did the 
validation. Sorry



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to