def set_device(usage=5):    
    "set the device that has usage < default usage  "
    device_ids = get_available_cuda(usage=usage)
    torch.cuda.set_device(device_ids[0])   # get the first available device
set the device that has usage < default usage  
PatchTST_self_supervised/src/basics.py