MCPcopy Create free account
hub / github.com/dhakalnirajan/LLaMA-BitNet / get_device

Function get_device

train.py:89–94  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

87# ──────────────────────────────────────────────────────────────────────────────
88
89def get_device() -> torch.device:
90 if torch.cuda.is_available():
91 return torch.device("cuda")
92 if torch.backends.mps.is_available():
93 return torch.device("mps")
94 return torch.device("cpu")
95
96
97def get_autocast_ctx(device: torch.device):

Callers 1

trainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected