mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-14 20:57:59 +00:00
Fixes https://github.com/pytorch/pytorch/issues/141305. ```python class M(torch.nn.Module): def forward(self, x, y, z): a = y.shape[0] b = z.shape[0] def true_fn(x): return x + a def false_fn(x): return x + b * z # When exporting with non-strict: a and b are symints, # so torch.compile need to wrap and trace symint inputs. return torch.cond(x.shape[0] > 5, true_fn, false_fn, (x,)) ``` In non-strict export, when inputs are annotated with dynamic shape, the a, and b in above example are torch.SymInt type. true_fn and false_fn will have closure that're of torch.SymInt types. The error is triggered because we didn't handle SymInt inputs in dynamo and ends up using a UserDefinedObjectVariable for it, which doesn't have a proxy. We added support by following how we handle SymBool input previously. Pull Request resolved: https://github.com/pytorch/pytorch/pull/141524 Approved by: https://github.com/zou3519 ghstack dependencies: #142185 |
||
|---|---|---|
| .. | ||
| attn_ft.py | ||
| attn_positional.py | ||
| common_utils.py | ||
| discover_coverage.py | ||
| functorch_additional_op_db.py | ||
| test_ac.py | ||
| test_aotdispatch.py | ||
| test_control_flow.py | ||
| test_dims.py | ||
| test_eager_transforms.py | ||
| test_logging.py | ||
| test_memory_efficient_fusion.py | ||
| test_minifier.py | ||
| test_ops.py | ||
| test_parsing.py | ||
| test_rearrange.py | ||
| test_vmap.py | ||
| test_vmap_registrations.py | ||
| xfail_suggester.py | ||