import torch


def get_device() -> torch.device:
    """
    Checks if cuda is available. If available, use cuda by default, else use cpu.

    Returns
    -------
        Device to be used.
    """
    return torch.device("cuda" if torch.cuda.is_available() else "cpu")