mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-15 21:00:47 +00:00
Fixes https://github.com/pytorch/pytorch/issues/144907 ``` class Foo(torch.nn.Module): def forward(self, val): return torch.full((80, 2), val, dtype=torch.float32) export(Foo(), args=(torch.tensor(1),)) ``` When we have a `torch.full` call like above, where the fill value is a scalar Tensor and not a scalar value, the FX graph from `_dynamo.export()` contains a single node: the full op. We run into a `PendingUnbackedSymbolNotFound` error, because the `item()` call is implicit; the UnbackedSymInt is extracted but goes directly into the data of the output tensor value, and we're then unable to locate it when we try to compute unbacked bindings. On the other hand, non-strict export doesn't face this, because an explicit `item()`, or `local_scalar_dense` node is inserted, and the unbacked binding is directly the example value of that node. This adds a dynamo handler to imitate what happens in non-strict. Pull Request resolved: https://github.com/pytorch/pytorch/pull/144999 Approved by: https://github.com/angelayi |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| opinfo_schema.py | ||
| random_dag.py | ||
| test_converter.py | ||
| test_cpp_serdes.py | ||
| test_db.py | ||
| test_draft_export.py | ||
| test_experimental.py | ||
| test_export.py | ||
| test_export_legacy.py | ||
| test_export_nonstrict.py | ||
| test_export_training_ir_to_run_decomp.py | ||
| test_functionalized_assertions.py | ||
| test_hop.py | ||
| test_lift_unlift.py | ||
| test_pass_infra.py | ||
| test_passes.py | ||
| test_retraceability.py | ||
| test_schema.py | ||
| test_serdes.py | ||
| test_serialize.py | ||
| test_sparse.py | ||
| test_swap.py | ||
| test_tools.py | ||
| test_torchbind.py | ||
| test_tree_utils.py | ||
| test_unflatten.py | ||
| test_unflatten_training_ir.py | ||
| test_verifier.py | ||
| testing.py | ||