pytorch/torch/_dynamo/variables
Joel Schlosser 6897631ceb Guard on inner tensor names for traceable wrapper subclasses (#129618)
Fixes #129601

Background: it's possible that a traceable wrapper subclass will have an optional inner tensor constituent (e.g. NJT's cached min / max sequence lengths). To specify this, the subclass's `__tensor_flatten__()` impl should leave out any unspecified optional inner tensors in the returned list of `attrs`.

This PR guards on the list of inner tensor `attrs` returned in `subclass.__tensor_flatten__()[0]`.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/129618
Approved by: https://github.com/anijain2305
2024-06-28 16:30:25 +00:00
..
__init__.py [Traceable FSDP2] Dynamo support FSDP2 use_training_state context manager (#127854) 2024-06-16 08:48:52 +00:00
base.py Add VariableTracker.debug_repr (#126299) 2024-05-15 23:55:29 +00:00
builder.py Guard on inner tensor names for traceable wrapper subclasses (#129618) 2024-06-28 16:30:25 +00:00
builtin.py [easy][dynamo] Remove try except from call_getattr (#129217) 2024-06-21 23:56:00 +00:00
constant.py [dynamo] Support enum construction (#127364) 2024-05-29 08:09:21 +00:00
ctx_manager.py [3.13, dynamo] codegen PUSH_NULL when callable is codegen'd (#129172) 2024-06-22 17:25:23 +00:00
dicts.py [dynamo][compile-time][inlining-inbuilt-nn-modules] Manually implement nn.Module._call_impl (#129285) 2024-06-25 01:31:26 +00:00
distributed.py support as_python_constant on PlacementClassVariable (#124398) 2024-05-01 21:56:01 +00:00
functions.py [3.13, dynamo] codegen PUSH_NULL when callable is codegen'd (#129172) 2024-06-22 17:25:23 +00:00
higher_order_ops.py Revert "[Inductor] FlexAttention supports block sparse mask (#129216)" 2024-06-28 05:44:46 +00:00
iter.py [dynamo] Improve constant-prop for regex/torch.__version__ (#123705) 2024-04-12 19:03:13 +00:00
lazy.py [dynamo] fix crash when context manager is passed to a function (#125321) 2024-05-03 23:01:30 +00:00
lists.py [3.13, dynamo] codegen PUSH_NULL when callable is codegen'd (#129172) 2024-06-22 17:25:23 +00:00
misc.py [dynamo][compile-time][inlining-inbuilt-nn-modules] Manually implement nn.Module._call_impl (#129285) 2024-06-25 01:31:26 +00:00
nn_module.py [dynamo][compile-time] Manually trace torch.nn.Module.parameters (#129583) 2024-06-27 06:06:04 +00:00
optimizer.py Fix capturable enablement conditions (#125826) 2024-05-11 06:29:59 +00:00
script_object.py Flip default value for mypy disallow_untyped_defs [1/11] (#127838) 2024-06-08 18:16:33 +00:00
sdpa.py [3.13, dynamo] codegen PUSH_NULL when callable is codegen'd (#129172) 2024-06-22 17:25:23 +00:00
tensor.py [3.13, dynamo] codegen PUSH_NULL when callable is codegen'd (#129172) 2024-06-22 17:25:23 +00:00
torch_function.py [Dynamo x torch_function] fix incorrect source (#128980) 2024-06-20 14:54:00 +00:00
torch.py [3.13, dynamo] codegen PUSH_NULL when callable is codegen'd (#129172) 2024-06-22 17:25:23 +00:00
user_defined.py [dynamo][compile-time] Manually trace torch.nn.Module.parameters (#129583) 2024-06-27 06:06:04 +00:00