"""Auto-generated stub for module: device."""
from typing import Any

# Functions
def move_to_device(model: Any, device: Any.Any) -> Any.Any:
    """
    Move a model to *device* and return the device used.
    
        Handles both plain ``nn.Module`` and wrapper objects that store the
        actual model in a ``.model`` attribute (e.g. the ``r2plus1d_Model``
        wrapper from the R2Plus1D BYOM repo).
    
        Args:
            model: A PyTorch ``nn.Module``, or a wrapper with a ``.model``
                attribute pointing to the actual module.
            device: Target device.
    
        Returns:
            The device the model was moved to (same as *device*).
    """
    ...
def resolve_device(preferred: str = 'cuda') -> Any.Any:
    """
    Select the best available compute device.
    
        Tries the *preferred* backend first, then falls back through the
        priority chain ``cuda → mps → cpu``.
    
        Args:
            preferred: Requested device — one of ``"cuda"``, ``"mps"``,
                or ``"cpu"``.
    
        Returns:
            A :class:`torch.device` for the selected backend.
    
        Example::
    
            device = resolve_device("cuda")
            model = model.to(device)
    """
    ...
