import torch


def default_device() -> str:
    """
    :return: the device that should be defaulted to for the current setup.
        if multiple gpus are available then will return a string with all of them,
        else if single gpu available then will return cuda,
        else returns cpu
    """

    if not torch.cuda.is_available():
        return "cpu"

    if torch.cuda.device_count() < 2:
        return "cuda"

    device_ids = [str(i) for i in range(torch.cuda.device_count())]

    return "cuda:{}".format(",".join(device_ids))