import torch


def get_device(gpus: int) -> torch.device:
    """
    Return the device type to use.

    If the system has GPUs available and the user didn't explicitly specify 0
    GPUs, the device type will be 'cuda'. Otherwise, the device type will be
    'cpu' which will be significantly slower.

    Parameters
    ----------
    gpus : int
        An ``int`` of the number of GPUs to use during training.

    Returns
    -------
    torch.device
        Returns the specific type of device to use for computations where
        applicable.
    """
    if gpus > 0:
        return torch.device('cuda')
    else:
        return torch.device('cpu')