pytorch/torch/_dynamo/variables
Yidi Wu 1e201422ed [export] add is_exporting flag (#142425)
We added an is_export flag under torch.compiler.is_exporting. This comes handy when we try to do some special logic in user-level and system-level (e.g. in upper of the stack).

In increasing-scope:
- `_is_fx_tracing` is set to True when we use under symbolic_trace or make_fx.
- `is_exporting` is set to True when we're doing strict or non-strict export, which internally has a step that calls make_fx and set _is_fx_tracing to be True.
- `is_compiling` is set to True when we're either doing strict, non-strict export or torch.compile.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/142425
Approved by: https://github.com/avikchaudhuri
2024-12-18 21:36:28 +00:00
..
__init__.py [dynamo][NFC] Rename NewCellVariable to CellVariable (#141628) 2024-12-02 19:09:30 +00:00
base.py Get rid of _lazy_import hack (#143213) 2024-12-14 03:46:21 +00:00
builder.py Get rid of _lazy_import hack (#143213) 2024-12-14 03:46:21 +00:00
builtin.py [dynamo] Support multiple inheritance for custom dict construction (#142416) 2024-12-13 05:13:05 +00:00
constant.py [dynamo] Expand support of enum attribute access (#142268) 2024-12-10 19:32:40 +00:00
ctx_manager.py [FSDP2] Move to public torch.distributed.fsdp (#141868) 2024-12-07 01:24:28 +00:00
dicts.py [dynamo] Support multiple inheritance for custom dict construction (#142416) 2024-12-13 05:13:05 +00:00
distributed.py [dynamo] Fix VariableBuilder._wrap on frozenset and enforce invariants on ConstantVariable (#141504) 2024-11-27 21:58:35 +00:00
functions.py [FSDP2] Move to public torch.distributed.fsdp (#141868) 2024-12-07 01:24:28 +00:00
higher_order_ops.py [FlexAttention] Fix broken eager tracing (#143344) 2024-12-17 09:42:36 +00:00
iter.py [BE]: Apply PERF401 autofixes from ruff (#140980) 2024-11-20 17:52:07 +00:00
lazy.py [dynamo] Replace __str__ with __repr__ in some places (#136316) 2024-10-21 19:50:38 +00:00
lists.py [dynamo] Use proper item source for NamedTupleVariable (#142437) 2024-12-10 19:23:48 +00:00
misc.py Remove unused Python variables in torch/[_-a]* (#133492) 2024-12-12 17:39:14 +00:00
nn_module.py [dynamo] Support multiple inheritance for custom dict construction (#142416) 2024-12-13 05:13:05 +00:00
optimizer.py Remove unused Python variables in torch/[_-a]* (#133492) 2024-12-12 17:39:14 +00:00
script_object.py Add basic mypy annotations to dynamo (#132415) 2024-08-04 18:43:36 +00:00
sdpa.py [dynamo] Simplify creation of VariableTrackers (#135714) 2024-10-18 09:36:46 +00:00
tensor.py Remove unused Python variables in torch/[_-a]* (#133492) 2024-12-12 17:39:14 +00:00
torch_function.py [dynamo] Simplify creation of VariableTrackers (#135714) 2024-10-18 09:36:46 +00:00
torch.py [export] add is_exporting flag (#142425) 2024-12-18 21:36:28 +00:00
user_defined.py Prevent users from seeing hardcoded print stmt when hypothesis is not installed (#142398) 2024-12-17 16:59:05 +00:00