# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/54_tens.ipynb.

# %% auto 0
__all__ = ['Tensor', 'Device', 'Dataset', 'DataLoader']

# %% ../nbs/54_tens.ipynb 6
import inspect
from numbers import Number

# %% ../nbs/54_tens.ipynb 8
import types
from typing import (
    Type, TypeAlias, Tuple,
    ClassVar, Any, Optional, Callable, Iterable, ForwardRef
)
from typing import TypeAlias, List, Union, Iterable, List

# %% ../nbs/54_tens.ipynb 11
try:
    import torch
    tensor = torch.Tensor
    device = torch.device
except ImportError:
    # Define a placeholder type if torch is not installed
    tensor = 'torch.Tensor'
    device = 'torch.device'

# %% ../nbs/54_tens.ipynb 12
try:
    from torch.utils.data import (
        Dataset as dataset, 
        DataLoader as dataloader
    )
except ImportError:
    tudata = 'torch.utils.data'
    dataset = ForwardRef(f'{tudata}.Dataset', module=tudata, is_class=True)
    dataloader = ForwardRef(f'{tudata}.DataLoader', module=tudata, is_class=True)

# %% ../nbs/54_tens.ipynb 14
#| export


# %% ../nbs/54_tens.ipynb 16
from .nums import Numbers

# %% ../nbs/54_tens.ipynb 19
Tensor: TypeAlias = tensor
Device: TypeAlias = device

# %% ../nbs/54_tens.ipynb 21
Dataset: TypeAlias = dataset
DataLoader: TypeAlias = dataloader
