Skip to content

Commit

Permalink
add GPU support on Mac
Browse files Browse the repository at this point in the history
  • Loading branch information
ilisin committed Jun 29, 2023
1 parent a093f51 commit 05cc499
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rlcard/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ def set_seed(seed):

def get_device():
import torch
if torch.cuda.is_available():
if torch.backends.mps.is_available():
device = torch.device("mps:0")
print("--> Running on the GPU")
elif torch.cuda.is_available():
device = torch.device("cuda:0")
print("--> Running on the GPU")
else:
Expand Down

0 comments on commit 05cc499

Please sign in to comment.