pytorch/test/export
Pian Pawakapan ffb424eab6 [dynamo/export] call local_scalar_dense when full() value is scalar tensor (#144999)
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
2025-01-31 02:45:43 +00:00
..
__init__.py
opinfo_schema.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
random_dag.py [BE] fix ruff rule E226: add missing whitespace around operator in f-strings (#144415) 2025-01-08 21:55:00 +00:00
test_converter.py PEP585 update - test (#145176) 2025-01-22 04:48:28 +00:00
test_cpp_serdes.py
test_db.py
test_draft_export.py [export] Add tlparse to draft-export (#145810) 2025-01-29 19:26:00 +00:00
test_experimental.py [export] handle buffer/input mutations for joint-graph (#144806) 2025-01-16 00:22:16 +00:00
test_export.py [dynamo/export] call local_scalar_dense when full() value is scalar tensor (#144999) 2025-01-31 02:45:43 +00:00
test_export_legacy.py EZ fix to make sure local pytest run succeeds in export (#144764) 2025-01-15 00:43:40 +00:00
test_export_nonstrict.py
test_export_training_ir_to_run_decomp.py
test_functionalized_assertions.py
test_hop.py [export] fix non-strict pre_dispatch exporting while_loop (#145762) 2025-01-30 18:58:34 +00:00
test_lift_unlift.py PEP585 update - test (#145176) 2025-01-22 04:48:28 +00:00
test_pass_infra.py [Codemod][AddExplicitStrictExportArg] caffe2/test (#143688) 2024-12-27 07:58:44 +00:00
test_passes.py PEP585 update - test (#145176) 2025-01-22 04:48:28 +00:00
test_retraceability.py
test_schema.py Tweak schema_check to handle annotated builtin types (#145154) 2025-01-19 18:48:35 +00:00
test_serdes.py
test_serialize.py [export] Load side info about pos/kw argument kind for serialization. (#144686) 2025-01-15 19:08:38 +00:00
test_sparse.py [Codemod][AddExplicitStrictExportArg] caffe2/test (#143688) 2024-12-27 07:58:44 +00:00
test_swap.py [Codemod][AddExplicitStrictExportArg] caffe2/test (#143688) 2024-12-27 07:58:44 +00:00
test_tools.py
test_torchbind.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_tree_utils.py
test_unflatten.py [Codemod][AddExplicitStrictExportArg] caffe2/test (#143688) 2024-12-27 07:58:44 +00:00
test_unflatten_training_ir.py
test_verifier.py
testing.py