-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.py
More file actions
17 lines (15 loc) · 694 Bytes
/
utils.py
File metadata and controls
17 lines (15 loc) · 694 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from IPython.display import display
def show_svg(svg):
display(svg)
# =============================================================================
# def get_compute_device():
# compute_device = None
# # detect gpu/cpu device to use
# if torch.backends.cuda.is_built():
# compute_device = torch.device('cuda:0') # 0th CUDA device
# if torch.backends.mps.is_available():
# compute_device = torch.device('mps') # For Apple silicon
# else:
# compute_device = torch.device("cpu") # Use CPU if no GPU
# return torch.device("cpu")#compute_device# compute_device
# =============================================================================