def default_device(use_cuda=True):
    "Return or set default device; `use_cuda`: None - CUDA if available; True - error if not available; False - CPU"
    if not torch.cuda.is_available():
        use_cuda = False
    return torch.device(torch.cuda.current_device()) if use_cuda else torch.device('cpu')
Return or set default device; `use_cuda`: None - CUDA if available; True - error if not available; False - CPU
PatchTST_self_supervised/src/basics.py