"""
This package implements variable tracking and symbolic execution capabilities for Dynamo,
which are essential for converting Python code into FX graphs. It provides a comprehensive
set of variable types that handle different Python constructs during tracing.

Each variable type (like BuiltinVariable, TensorVariable, NNModuleVariable, etc.) is responsible
for tracking and symbolically executing operations on specific Python objects. This enables
Dynamo to:
- Track the flow of values through Python code
- Maintain correct semantics during graph conversion
- Handle complex Python features like context managers, iterators, and custom objects
- Support both eager and symbolic execution modes

The VariableTracker base class provides the foundation for all variable types, with each
subclass implementing specific behavior for different Python constructs. This modular design
allows Dynamo to accurately trace and optimize Python code while preserving its semantics.
"""

from .base import VariableTracker
from .builtin import (
    BaseBuiltinVariable,
    BuiltinVariable,
    DictBuiltinVariable,
    GetAttrBuiltinVariable,
    HasAttrBuiltinVariable,
    IterBuiltinVariable,
    ListBuiltinVariable,
    SetAttrBuiltinVariable,
)
from .constant import ConstantVariable
from .ctx_manager import (
    AcceleratorDeviceIndexVariable,
    CatchWarningsCtxManagerVariable,
    ContextWrappingVariable,
    CUDADeviceVariable,
    CudagraphOverrideVariable,
    DisabledSavedTensorsHooksVariable,
    DualLevelContextManager,
    DynamoConfigPatchVariable,
    ErrorOnGraphBreakVariable,
    FSDPParamGroupUseTrainingStateVariable,
    FxTracebackAnnotateVariable,
    GenericContextWrappingVariable,
    get_device_context_manager,
    GradIncrementNestingCtxManagerVariable,
    GradInplaceRequiresGradCtxManagerVariable,
    GradModeVariable,
    InferenceModeVariable,
    JvpIncrementNestingCtxManagerVariable,
    register_device_context_manager,
    SDPAKernelVariable,
    SetFwdGradEnabledContextManager,
    TemporarilyPopInterpreterStackCtxManagerVariable,
    VmapIncrementNestingCtxManagerVariable,
    WithEnterFunctionVariable,
    WithExitFunctionVariable,
    XPUDeviceVariable,
)
from .dicts import (
    ConstDictVariable,
    DictItemsVariable,
    DictViewVariable,
    DunderDictVariable,
    MappingProxyVariable,
    NNModuleHooksDictVariable,
)
from .distributed import BackwardHookVariable, DistributedVariable
from .functions import (
    BaseUserFunctionVariable,
    BoundBuiltinMethodVariable,
    ClassMethodDescriptorVariable,
    ClassMethodVariable,
    CollectionsNamedTupleFunction,
    CreateTMADescriptorExperimentalVariable,
    CreateTMADescriptorStableVariable,
    FunctionDecoratedByContextlibContextManagerVariable,
    FunctoolsPartialVariable,
    GetSetDescriptorVariable,
    InspectSignatureVariable,
    LocalGeneratorFunctionVariable,
    LocalGeneratorObjectVariable,
    MemberDescriptorVariable,
    MethodDescriptorVariable,
    MethodWrapperVariable,
    NestedUserFunctionVariable,
    PolyfilledFunctionVariable,
    PropertyVariable,
    PyTreeGetNodeTypeFunctionVariable,
    PyTreeTreeIsLeafFunctionVariable,
    SkipFunctionVariable,
    SparseTensorCreationSkipVariable,
    StaticMethodVariable,
    TMADescriptorExperimentalVariable,
    TMADescriptorStableVariable,
    TritonSetAllocatorVariable,
    TupleGetterVariable,
    UserFunctionVariable,
    UserMethodVariable,
    WrapperDescriptorVariable,
    WrapperUserFunctionVariable,
    WrapperUserMethodVariable,
)
from .higher_order_ops import (
    FunctionalCallVariable,
    FunctorchHigherOrderVariable,
    ReparametrizeModuleCallVariable,
    TorchHigherOrderOperatorVariable,
)
from .iter import (
    CountIteratorVariable,
    FilterVariable,
    IteratorVariable,
    ItertoolsVariable,
    MapVariable,
    RepeatIteratorVariable,
    ZipVariable,
)
from .lazy import LazyConstantVariable, LazyVariableTracker
from .lists import (
    BaseListVariable,
    DequeVariable,
    ListIteratorVariable,
    ListVariable,
    RangeVariable,
    SliceVariable,
    TupleIteratorVariable,
    TupleVariable,
)
from .misc import (
    AutogradFunctionContextVariable,
    AutogradFunctionVariable,
    CellVariable,
    DeletedVariable,
    ExceptionVariable,
    GetAttrVariable,
    LambdaVariable,
    NewGlobalVariable,
    NumpyVariable,
    ObjectVariable,
    PythonModuleVariable,
    RandomClassVariable,
    RandomVariable,
    StringFormatVariable,
    SuperVariable,
    TracebackVariable,
    TypingVariable,
    UnknownVariable,
    WeakRefVariable,
)
from .nn_module import (
    FSDPManagedNNModuleVariable,
    NNModuleVariable,
    UnspecializedBuiltinNNModuleVariable,
    UnspecializedNNModuleVariable,
)
from .optimizer import OptimizerVariable
from .sdpa import SDPAParamsVariable
from .sets import (
    DictKeySetVariable,
    FrozensetVariable,
    OrderedSetClassVariable,
    OrderedSetVariable,
    SetVariable,
)
from .streams import (
    CudaStreamVariable,
    EventVariable,
    StreamContextVariable,
    StreamVariable,
)
from .tensor import (
    DataPtrVariable,
    FakeItemVariable,
    NumpyNdarrayVariable,
    SymNodeVariable,
    TensorVariable,
    UnspecializedPythonVariable,
    UntypedStorageVariable,
)
from .torch import TorchCtxManagerClassVariable, TorchInGraphFunctionVariable
from .user_defined import (
    DefaultDictVariable,
    FrozenDataClassVariable,
    InspectVariable,
    MutableMappingVariable,
    NamedTupleVariable,
    OrderedDictVariable,
    RemovableHandleVariable,
    StructSequenceVariable,
    UserDefinedClassVariable,
    UserDefinedConstantVariable,
    UserDefinedDictVariable,
    UserDefinedExceptionClassVariable,
    UserDefinedExceptionObjectVariable,
    UserDefinedListVariable,
    UserDefinedObjectVariable,
    UserDefinedSetVariable,
    UserDefinedTupleVariable,
    UserDefinedVariable,
)


__all__ = [
    "AcceleratorDeviceIndexVariable",
    "AutogradFunctionContextVariable",
    "AutogradFunctionVariable",
    "BackwardHookVariable",
    "BaseBuiltinVariable",
    "BaseListVariable",
    "BuiltinVariable",
    "CatchWarningsCtxManagerVariable",
    "CellVariable",
    "ConstantVariable",
    "ConstDictVariable",
    "ContextWrappingVariable",
    "CountIteratorVariable",
    "CreateTMADescriptorExperimentalVariable",
    "CreateTMADescriptorStableVariable",
    "CUDADeviceVariable",
    "CudagraphOverrideVariable",
    "DataPtrVariable",
    "DefaultDictVariable",
    "DeletedVariable",
    "DictBuiltinVariable",
    "DictKeySetVariable",
    "DynamoConfigPatchVariable",
    "ErrorOnGraphBreakVariable",
    "FakeItemVariable",
    "get_device_context_manager",
    "GetAttrBuiltinVariable",
    "GetAttrVariable",
    "GradModeVariable",
    "HasAttrBuiltinVariable",
    "InspectSignatureVariable",
    "InspectVariable",
    "IterBuiltinVariable",
    "IteratorVariable",
    "ItertoolsVariable",
    "LambdaVariable",
    "LazyConstantVariable",
    "LazyVariableTracker",
    "ListBuiltinVariable",
    "ListIteratorVariable",
    "ListVariable",
    "MappingProxyVariable",
    "NamedTupleVariable",
    "NestedUserFunctionVariable",
    "NewGlobalVariable",
    "NNModuleVariable",
    "NumpyNdarrayVariable",
    "NumpyVariable",
    "OptimizerVariable",
    "OrderedDictVariable",
    "PolyfilledFunctionVariable",
    "PythonModuleVariable",
    "RangeVariable",
    "register_device_context_manager",
    "RemovableHandleVariable",
    "RepeatIteratorVariable",
    "SDPAParamsVariable",
    "SetAttrBuiltinVariable",
    "SkipFunctionVariable",
    "SliceVariable",
    "StringFormatVariable",
    "StructSequenceVariable",
    "SuperVariable",
    "TemporarilyPopInterpreterStackCtxManagerVariable",
    "TensorVariable",
    "TMADescriptorExperimentalVariable",
    "TMADescriptorStableVariable",
    "TorchCtxManagerClassVariable",
    "TorchInGraphFunctionVariable",
    "TupleVariable",
    "UnknownVariable",
    "UnspecializedNNModuleVariable",
    "UnspecializedPythonVariable",
    "UntypedStorageVariable",
    "UserDefinedClassVariable",
    "UserDefinedObjectVariable",
    "UserDefinedTupleVariable",
    "UserFunctionVariable",
    "UserMethodVariable",
    "VariableTracker",
    "WithEnterFunctionVariable",
    "WithExitFunctionVariable",
    "XPUDeviceVariable",
]
