Skip to content

Commit

Permalink
Merge pull request #296 from ilisin/master
Browse files Browse the repository at this point in the history
add GPU support on Mac
  • Loading branch information
daochenzha authored Jul 11, 2023
2 parents a093f51 + 05cc499 commit 7fc56ed
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 7fc56ed

Please sign in to comment.