#!/usr/bin/env python
# -*- coding: utf-8 -*-

from typing import TYPE_CHECKING

from pythonwrench.typing.classes import BuiltinNumber, BuiltinScalar
from torch import Tensor
from torch.types import Number

from torchwrench.core.dtype_enum import DTypeEnum
from torchwrench.core.make import DeviceLike, DTypeLike, GeneratorLike

if TYPE_CHECKING:
    from ._typing import T_Tensor, T_TensorOrArray, TensorOrArray
    from .guards import (
        is_builtin_number,
        is_builtin_scalar,
        is_integral_dtype,
        is_number_like,
        is_numpy_number_like,
        is_numpy_scalar_like,
        is_scalar_like,
        is_tensor_or_array,
    )
    from .tensor_subclasses import (
        BoolTensor,
        BoolTensor0D,
        BoolTensor1D,
        BoolTensor2D,
        BoolTensor3D,
        ByteTensor,
        ByteTensor0D,
        ByteTensor1D,
        ByteTensor2D,
        ByteTensor3D,
        CDoubleTensor,
        CDoubleTensor0D,
        CDoubleTensor1D,
        CDoubleTensor2D,
        CDoubleTensor3D,
        CFloatTensor,
        CFloatTensor0D,
        CFloatTensor1D,
        CFloatTensor2D,
        CFloatTensor3D,
        CharTensor,
        CharTensor0D,
        CharTensor1D,
        CharTensor2D,
        CharTensor3D,
        ComplexFloatingTensor,
        ComplexFloatingTensor0D,
        ComplexFloatingTensor1D,
        ComplexFloatingTensor2D,
        ComplexFloatingTensor3D,
        DoubleTensor,
        DoubleTensor0D,
        DoubleTensor1D,
        DoubleTensor2D,
        DoubleTensor3D,
        FloatingTensor,
        FloatingTensor0D,
        FloatingTensor1D,
        FloatingTensor2D,
        FloatingTensor3D,
        FloatTensor,
        FloatTensor0D,
        FloatTensor1D,
        FloatTensor2D,
        FloatTensor3D,
        HalfTensor,
        HalfTensor0D,
        HalfTensor1D,
        HalfTensor2D,
        HalfTensor3D,
        IntegralTensor,
        IntegralTensor0D,
        IntegralTensor1D,
        IntegralTensor2D,
        IntegralTensor3D,
        IntTensor,
        IntTensor0D,
        IntTensor1D,
        IntTensor2D,
        IntTensor3D,
        LongTensor,
        LongTensor0D,
        LongTensor1D,
        LongTensor2D,
        LongTensor3D,
        RealTensor,
        RealTensor0D,
        RealTensor1D,
        RealTensor2D,
        RealTensor3D,
        ShortTensor,
        ShortTensor0D,
        ShortTensor1D,
        ShortTensor2D,
        ShortTensor3D,
        SignedIntegerTensor,
        SignedIntegerTensor0D,
        SignedIntegerTensor1D,
        SignedIntegerTensor2D,
        SignedIntegerTensor3D,
        Tensor0D,
        Tensor1D,
        Tensor2D,
        Tensor3D,
        UnsignedIntegerTensor,
        UnsignedIntegerTensor0D,
        UnsignedIntegerTensor1D,
        UnsignedIntegerTensor2D,
        UnsignedIntegerTensor3D,
    )

else:
    import lazy_loader as lazy

    __getattr__, __dir__, __all__ = lazy.attach(
        __name__,
        submodules=["guards", "tensor_subclasses", "variable_fns"],
        submod_attrs={
            "_typing": ["T_Tensor", "T_TensorOrArray", "TensorOrArray"],
            "guards": [
                "is_builtin_number",
                "is_builtin_scalar",
                "is_integral_dtype",
                "is_number_like",
                "is_numpy_number_like",
                "is_numpy_scalar_like",
                "is_scalar_like",
                "is_tensor_or_array",
            ],
            "tensor_subclasses": [
                "BoolTensor",
                "BoolTensor0D",
                "BoolTensor1D",
                "BoolTensor2D",
                "BoolTensor3D",
                "ByteTensor",
                "ByteTensor0D",
                "ByteTensor1D",
                "ByteTensor2D",
                "ByteTensor3D",
                "CDoubleTensor",
                "CDoubleTensor0D",
                "CDoubleTensor1D",
                "CDoubleTensor2D",
                "CDoubleTensor3D",
                "CFloatTensor",
                "CFloatTensor0D",
                "CFloatTensor1D",
                "CFloatTensor2D",
                "CFloatTensor3D",
                "CharTensor",
                "CharTensor0D",
                "CharTensor1D",
                "CharTensor2D",
                "CharTensor3D",
                "ComplexFloatingTensor",
                "ComplexFloatingTensor0D",
                "ComplexFloatingTensor1D",
                "ComplexFloatingTensor2D",
                "ComplexFloatingTensor3D",
                "DoubleTensor",
                "DoubleTensor0D",
                "DoubleTensor1D",
                "DoubleTensor2D",
                "DoubleTensor3D",
                "FloatingTensor",
                "FloatingTensor0D",
                "FloatingTensor1D",
                "FloatingTensor2D",
                "FloatingTensor3D",
                "FloatTensor",
                "FloatTensor0D",
                "FloatTensor1D",
                "FloatTensor2D",
                "FloatTensor3D",
                "HalfTensor",
                "HalfTensor0D",
                "HalfTensor1D",
                "HalfTensor2D",
                "HalfTensor3D",
                "IntegralTensor",
                "IntegralTensor0D",
                "IntegralTensor1D",
                "IntegralTensor2D",
                "IntegralTensor3D",
                "IntTensor",
                "IntTensor0D",
                "IntTensor1D",
                "IntTensor2D",
                "IntTensor3D",
                "LongTensor",
                "LongTensor0D",
                "LongTensor1D",
                "LongTensor2D",
                "LongTensor3D",
                "RealTensor",
                "RealTensor0D",
                "RealTensor1D",
                "RealTensor2D",
                "RealTensor3D",
                "ShortTensor",
                "ShortTensor0D",
                "ShortTensor1D",
                "ShortTensor2D",
                "ShortTensor3D",
                "SignedIntegerTensor",
                "SignedIntegerTensor0D",
                "SignedIntegerTensor1D",
                "SignedIntegerTensor2D",
                "SignedIntegerTensor3D",
                "Tensor0D",
                "Tensor1D",
                "Tensor2D",
                "Tensor3D",
                "UnsignedIntegerTensor",
                "UnsignedIntegerTensor0D",
                "UnsignedIntegerTensor1D",
                "UnsignedIntegerTensor2D",
                "UnsignedIntegerTensor3D",
            ],
        },
    )

del TYPE_CHECKING
