MCPcopy
hub / github.com/coqui-ai/TTS / get_device_id

Function get_device_id

tests/__init__.py:7–16  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5
6
7def get_device_id():
8 use_cuda, _ = get_cuda()
9 if use_cuda:
10 if "CUDA_VISIBLE_DEVICES" in os.environ and os.environ["CUDA_VISIBLE_DEVICES"] != "":
11 GPU_ID = os.environ["CUDA_VISIBLE_DEVICES"].split(",")[0]
12 else:
13 GPU_ID = "0"
14 else:
15 GPU_ID = ""
16 return GPU_ID
17
18
19def get_tests_path():

Calls 1

get_cudaFunction · 0.90

Tested by 1

run_test_trainFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…